From 75836c0435068b1edab7b07739b311d0180130fd Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 9 Mar 2021 21:35:05 -0300 Subject: Fix: some enhancements --- vimrc.dot.link | 239 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 122 insertions(+), 117 deletions(-) diff --git a/vimrc.dot.link b/vimrc.dot.link index 21764e5..114386d 100644 --- a/vimrc.dot.link +++ b/vimrc.dot.link @@ -20,6 +20,7 @@ set shortmess+=I set ignorecase set smartcase filetype indent off +let mapleader="-" " Window title handling set title @@ -28,7 +29,10 @@ set titlestring=vim:\ %F " See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file "set autochdir -autocmd BufEnter * silent! lcd %:p:h +augroup changedir + autocmd! + autocmd BufEnter * silent! lcd %:p:h +augroup END " Thanks to http://stackoverflow.com/questions/1673649/vimrc-action-onclose function! ResetTitle(title) @@ -161,142 +165,144 @@ let g:syntastic_mode_map={ 'mode': 'passive', set timeoutlen=0 ttimeoutlen=0 " Write, quit and close shortcuts using Esc notation (works also with ) -nmap n :tabnew -nmap t :NERDTree -nmap T :T -"nmap q :wqa -"map c :wqa -nmap f :wq -nmap c :tabclose -"map e :tabclose -nmap b :NERDTreeFromBookmark -nmap B :B -nmap s :OpenSession -"nmap m :q! +nnoremap n :tabnew +nnoremap t :NERDTree +nnoremap T :T +"nnoremap q :wqa +"noremap c :wqa +nnoremap f :wq +nnoremap c :tabclose +"noremap e :tabclose +nnoremap b :NERDTreeFromBookmark +nnoremap B :B +nnoremap s :OpenSession +"nnoremap m :q! " We're closing the buffer instead of just the window to avoid slowness due to too many opened buffers -nmap m :bd -nmap w :w -nmap u :!up -imap n :tabnew -imap t :NERDTree -imap t :T -"imap q :wqa -"map c :wqa -imap f :wq -imap c :tabclose -"map e :tabclose -"imap m :q! +nnoremap m :bd +nnoremap w :w +nnoremap u :!up +inoremap n :tabnew +inoremap t :NERDTree +inoremap t :T +"inoremap q :wqa +"noremap c :wqa +inoremap f :wq +inoremap c :tabclose +"noremap e :tabclose +"inoremap m :q! " We're closing the buffer instead of just the window to avoid slowness due to too many opened buffers -imap m :bd -imap w :w +inoremap m :bd +inoremap w :w " Write, quit and close shortcuts using Alt-key combo notation -"map n :tabnew -"map t :OpenNERDTree -"map q :wqa -"map c :wqa -"map f :wq -"map c :tabclose -"map e :tabclose -"nmap b :NERDTreeFromBookmark -"nmap B :B -"nmap s :OpenSession -"map m :q! -"map w :w -"map u :!up -"imap n :tabnew -"imap t :OpenNERDTree -"imap q :wqa -"imap c :wqa -"imap f :wq -"imap c :tabclose -"imap e :tabclose -"imap m :q! -"imap w :w +"noremap n :tabnew +"noremap t :OpenNERDTree +"noremap q :wqa +"noremap c :wqa +"noremap f :wq +"noremap c :tabclose +"noremap e :tabclose +"nnoremap b :NERDTreeFromBookmark +"nnoremap B :B +"nnoremap s :OpenSession +"noremap m :q! +"noremap w :w +"noremap u :!up +"inoremap n :tabnew +"inoremap t :OpenNERDTree +"inoremap q :wqa +"inoremap c :wqa +"inoremap f :wq +"inoremap c :tabclose +"inoremap e :tabclose +"inoremap m :q! +"inoremap w :w " Write, quit and close shortcuts using Ctrl-key combos " We're using these due to a conflict with wyrd(1) -"nmap :tabnew -"nmap :OpenNERDTree -"nmap :wqa -"nmap :wqa -"nmap :wq -"nmap :tabclose -"nmap :tabclose -"nmap :NERDTreeFromBookmark -"nmap :B -"nmap :OpenSession -"nmap :q! -"nmap :w -"imap :tabnew -"imap :OpenNERDTree -"imap :wqa -"imap :wqa -"imap :wq -"imap :tabclose -"imap :tabclose -"imap :q! -"imap :w +"nnoremap :tabnew +"nnoremap :OpenNERDTree +"nnoremap :wqa +"nnoremap :wqa +"nnoremap :wq +"nnoremap :tabclose +"nnoremap :tabclose +"nnoremap :NERDTreeFromBookmark +"nnoremap :B +"nnoremap :OpenSession +"nnoremap :q! +"nnoremap :w +"inoremap :tabnew +"inoremap :OpenNERDTree +"inoremap :wqa +"inoremap :wqa +"inoremap :wq +"inoremap :tabclose +"inoremap :tabclose +"inoremap :q! +"inoremap :w " Write, quit and close shortcuts -map q :wqa -"map f :wq -"map t :tabclose -"map m :q! -"map w :w -map h :tabnew +noremap q :wqa +"noremap f :wq +"noremap t :tabclose +"noremap m :q! +"noremap w :w +noremap h :tabnew " Tab navigation " See http://vim.wikia.com/wiki/Alternative_tab_navigation " http://comments.gmane.org/gmane.os.cygwin.xfree/16419 -nmap [5^ -nmap [6^ +nnoremap [5^ +nnoremap [6^ nnoremap :tabn nnoremap :tabp -nmap 1 1gt -nmap 2 2gt -nmap 3 3gt -nmap 4 4gt -nmap 5 5gt -nmap 6 6gt -nmap 7 7gt -nmap 8 8gt -nmap 9 9gt -nmap 0 10gt +nnoremap 1 1gt +nnoremap 2 2gt +nnoremap 3 3gt +nnoremap 4 4gt +nnoremap 5 5gt +nnoremap 6 6gt +nnoremap 7 7gt +nnoremap 8 8gt +nnoremap 9 9gt +nnoremap 0 10gt " Buffer navigation: Alt-{Up,Down} -map Od :bprevious -map Oc :bnext +noremap Od :bprevious +noremap Oc :bnext " Window navigation -"map -"map -"map -"map -"imap -"imap -"imap -"imap -"map  -"map  -"map  -"map  -"imap  -"imap  -"imap  -"imap  -nmap -nmap -nmap -nmap -imap -imap -imap -imap +"noremap +"noremap +"noremap +"noremap +"inoremap +"inoremap +"inoremap +"inoremap +"noremap  +"noremap  +"noremap  +"noremap  +"inoremap  +"inoremap  +"inoremap  +"inoremap  +nnoremap +nnoremap +nnoremap +nnoremap +inoremap +inoremap +inoremap +inoremap " NERDTree section " Thanks to http://stackoverflow.com/questions/1447334/how-do-you-add-nerdtree-to-your-vimrc +let NERDTreeMinimalUI=1 + augroup nerdtree autocmd! " Open NERDTree when vim starts @@ -334,8 +340,8 @@ command -nargs=0 OpenNERDTree :call OpenNERDTree() " See http://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv "imap + "vmap c"+p -vmap "+yi -vmap "+c +vnoremap "+yi +vnoremap "+c " Workaround for mail editing. There must be a plugin enabling autoindent in " mail composition, which is annoying. @@ -400,7 +406,6 @@ let g:session_autosave_silent=1 let g:session_autosave='yes' let g:session_autoload='no' let g:session_directory='~/.local/share/vim/sessions' -let NERDTreeMinimalUI=1 " Autosave " See https://github.com/vim-scripts/vim-auto-save -- cgit v1.2.3