From f0b95ba7b7544c5b13504bb592e01680db56dc06 Mon Sep 17 00:00:00 2001 From: Xamora Date: Wed, 10 Jan 2024 14:25:55 +0100 Subject: [PATCH] add focus unfocus on Nerdtree and new control on foot to font size --- foot.ini | 10 +++++++--- init.vim | 30 ++++++++++++++++++++-------- sway-config | 57 +++++++++++++++++++++++++++-------------------------- 3 files changed, 58 insertions(+), 39 deletions(-) diff --git a/foot.ini b/foot.ini index 3a81cbf..0a05481 100644 --- a/foot.ini +++ b/foot.ini @@ -55,6 +55,7 @@ # launch=xdg-open ${url} # label-letters=sadfjklewcmpgh # osc8-underline=url-mode + # protocols=http, https, ftp, ftps, file, gemini, gopher # uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] @@ -138,9 +139,12 @@ # clipboard-paste=Control+Shift+v XF86Paste # primary-paste=Shift+Insert # search-start=Control+Shift+r -font-increase=Control+Mod4+Up -font-decrease=Control+Mod4+Down -font-reset=Control+Mod4+Left Control+Mod4+Right + +# Mod4 = Super; Mod1 = Alt +font-increase=Mod4+Mod1+Up +font-decrease=Mod4+Mod1+Down +font-reset=Mod4+Mod1+Left Mod4+Mod1+Right + # spawn-terminal=Control+Shift+n # minimize=none # maximize=none diff --git a/init.vim b/init.vim index 3a8c1ad..a2759a3 100644 --- a/init.vim +++ b/init.vim @@ -1,9 +1,3 @@ -set number -set relativenumber -set autoindent -set tabstop=4 -"set list -"set listchars=tab:>. set shiftwidth=4 set smarttab set softtabstop=4 @@ -20,6 +14,8 @@ Plug 'https://github.com/vim-scripts/gmlua.vim' " Utility Plug 'https://github.com/vim-airline/vim-airline' Plug 'https://github.com/preservim/nerdtree' +Plug 'https://github.com/baopham/vim-nerdtree-unfocus' "Add Unfocus command +Plug 'https://github.com/jistr/vim-nerdtree-tabs' "Other plugin for NerdTree Plug 'http://github.com/tpope/vim-surround' Plug 'https://github.com/tpope/vim-commentary' Plug 'https://github.com/lifepillar/pgsql.vim' " PSQL Pluging needs :SQLSetType pgsql.vim @@ -34,9 +30,27 @@ Plug 'norcalli/nvim-colorizer.lua' "Color Hexadecimal call plug#end() -" Keybinding -nnoremap :NERDTreeFocus +" NerdTree +" Start NERDTree and put the cursor back in the other window. +autocmd VimEnter * NERDTree | wincmd p +" Exit Vim if NERDTree is the only window remaining in the only tab. +autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif + +" Focus and unfocus +function! ToggleNERDTree() + if exists("g:NERDTree") && g:NERDTree.IsOpen() && bufname('%') =~ 'NERD_tree_' + wincmd p + else + NERDTreeFocus + endif +endfunction + +nnoremap :call ToggleNERDTree() nnoremap :NERDTreeToggle +nnoremap :NERDTreeFind +" Unfocus on the file open + +" nnoremap :TagbarToggle " Symbol for folder in nerd tree diff --git a/sway-config b/sway-config index e099c74..b0aa425 100644 --- a/sway-config +++ b/sway-config @@ -27,7 +27,7 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill # # Example configuration: # -# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# output HDMI-A-1 reaolution 1920x1080 position 1920,0 # # You can get the names of your outputs by running: swaymsg -t get_outputs @@ -57,7 +57,7 @@ exec swayidle -w \ # Read `man 5 sway-input` for more information about this section. input * { - xkb_layout "fr" + xkb_layout us_qwerty-fr repeat_delay 180 repeat_rate 30 } @@ -70,7 +70,7 @@ input * { bindsym $mod+Return exec $term # Kill focused window - bindsym $mod+Shift+q kill + bindsym $mod+Shift+a kill # Start your launcher bindsym $mod+d exec $menu @@ -112,32 +112,33 @@ input * { bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right - bindsym $mod+Shift+w unfocus + bindsym $mod+Shift+z unfocus # # Workspaces: # # Switch to workspace - bindsym $mod+ampersand workspace 1 - bindsym $mod+eacute workspace 2 - bindsym $mod+quotedbl workspace 3 - bindsym $mod+apostrophe workspace 4 - bindsym $mod+parenleft workspace 5 - bindsym $mod+minus workspace 6 - bindsym $mod+egrave workspace 7 - bindsym $mod+underscore workspace 8 - bindsym $mod+ccedilla workspace 9 - bindsym $mod+agrave workspace 10 + bindsym $mod+1 workspace 1 + bindsym $mod+2 workspace 2 + bindsym $mod+3 workspace 3 + bindsym $mod+4 workspace 4 + bindsym $mod+5 workspace 5 + bindsym $mod+6 workspace 6 + bindsym $mod+7 workspace 7 + bindsym $mod+8 workspace 8 + bindsym $mod+9 workspace 9 + bindsym $mod+0 workspace 10 # Move focused container to workspace - bindsym $mod+Shift+ampersand move container to workspace 1 - bindsym $mod+Shift+eacute move container to workspace 2 - bindsym $mod+Shift+quotedbl move container to workspace 3 - bindsym $mod+Shift+apostrophe move container to workspace 4 - bindsym $mod+Shift+parenleft move container to workspace 5 - bindsym $mod+Shift+minus move container to workspace 6 - bindsym $mod+Shift+egrave move container to workspace 7 - bindsym $mod+Shift+underscore move container to workspace 8 - bindsym $mod+Shift+ccedilla move container to workspace 9 - bindsym $mod+Shift+agrave move container to workspace 10 + bindsym $mod+Shift+1 move container to workspace 1 + bindsym $mod+Shift+2 move container to workspace 2 + bindsym $mod+Shift+3 move container to workspace 3 + bindsym $mod+Shift+4 move container to workspace 4 + bindsym $mod+Shift+5 move container to workspace 5 + bindsym $mod+Shift+6 move container to workspace 6 + bindsym $mod+Shift+7 move container to workspace 7 + bindsym $mod+Shift+8 move container to workspace 8 + bindsym $mod+Shift+9 move container to workspace 9 + bindsym $mod+Shift+0 move container to workspace 10 + # Note: workspaces can have any name you want, not just numbers. # We just use 1-10 as the default. # @@ -152,7 +153,7 @@ input * { # Switch the current container between different layout styles bindsym $mod+c layout stacking bindsym $mod+x layout tabbed - bindsym $mod+w layout toggle split + bindsym $mod+z layout toggle split # Make the current focus fullscreen bindsym $mod+f fullscreen @@ -164,7 +165,7 @@ input * { bindsym $mod+space focus mode_toggle # Move focus to the parent container - bindsym $mod+a focus parent + bindsym $mod+q focus parent # # Scratchpad: # @@ -172,11 +173,11 @@ input * { # You can send windows there and get them back later. # Move the currently focused window to the scratchpad - bindsym $mod+Shift+7 move scratchpad +# bindsym $mod+Shift+& move scratchpad # Show the next scratchpad window or hide the focused scratchpad window. # If there are multiple scratchpad windows, this command cycles through them. - bindsym $mod+7 scratchpad show +# bindsym $mod+& scratchpad show # # Resizing containers: #