Make moving lines easier in vim and change the tab listchar

This commit is contained in:
Michael Campagnaro 2023-06-13 14:56:35 -04:00
parent 2a57ce8837
commit c7845e62d9

8
vimrc
View File

@ -382,7 +382,8 @@ if executable('rg')
set grepprg=rg\ --vimgrep\ --hidden " Requires ripgrep to be installed. set grepprg=rg\ --vimgrep\ --hidden " Requires ripgrep to be installed.
endif endif
set list listchars=tab:»·,trail" Show trailing whitespace. " Show trailing tabs and whitespace.
set listchars=tab:»\ ,trail,extends:>,precedes:<,nbsp:+
set timeoutlen=250 ttimeoutlen=0 " Don't set it too low otherwise you won't be able to type use multi-key sequences. set timeoutlen=250 ttimeoutlen=0 " Don't set it too low otherwise you won't be able to type use multi-key sequences.
@ -609,6 +610,10 @@ noremap <c-h> <c-w><Left>
:cnoremap <C-J> <S-Left> :cnoremap <C-J> <S-Left>
:cnoremap <C-K> <S-Right> :cnoremap <C-K> <S-Right>
" Move a line under the cursor.
noremap <S-j> :m-2<cr>
noremap <S-k> :m+<cr>
" Window splitting - couldn't figure out how to remap <c-w>v & <c-w>n to <c-m> " Window splitting - couldn't figure out how to remap <c-w>v & <c-w>n to <c-m>
" & <c-n> " & <c-n>
noremap <leader>m :vsplit<cr> noremap <leader>m :vsplit<cr>
@ -774,6 +779,7 @@ noremap Q <Nop>
"################################################################################## "##################################################################################
" MULTIPURPOSE TAB KEY " MULTIPURPOSE TAB KEY
"################################################################################## "##################################################################################
fu! InsertTabWrapper() fu! InsertTabWrapper()
let l:col = col('.') - 1 let l:col = col('.') - 1
if !l:col || getline('.')[l:col - 1] !~ '\k' if !l:col || getline('.')[l:col - 1] !~ '\k'