summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2023-03-22 23:11:26 -0400
committerAdam T. Carpenter <atc@53hor.net>2023-03-22 23:11:26 -0400
commitb7116c6a913121be7d002bc4f678fb1fd4c2f20f (patch)
tree9b1ceec7aa1bafd95deebc04f07de9820d6b5385
parent5117752183c967173b3946f9458558dab6cd016d (diff)
downloaddotfiles-b7116c6a913121be7d002bc4f678fb1fd4c2f20f.tar.xz
dotfiles-b7116c6a913121be7d002bc4f678fb1fd4c2f20f.zip
feat: add tabs and cycling to vimrc
-rw-r--r--.vimrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index a332d7c..fde8f0f 100644
--- a/.vimrc
+++ b/.vimrc
@@ -6,6 +6,7 @@ set ttimeout " time out for key codes
set ttimeoutlen=100 " wait up to 100ms after Esc for special key
set display=truncate " show @@@ in the last line if it is truncated
set scrolloff=5 " show a few lines around the cursor
+set number
set relativenumber " relative line numbering
set tabstop=4 " 4-space tabs
set softtabstop=4 " 4-space tabs
@@ -13,6 +14,7 @@ set shiftwidth=4 " 4-space shiftwidth
set backspace=indent,eol,start " backspace over everything in insert
set directory=$HOME/.vim/swapfiles// " common swap directory
set fillchars+=vert:\
+set showtabline=2 " always show tab bar
syntax enable " switch syntax highlighting on, used to be syntax on
" Matching and key mappings
@@ -27,6 +29,9 @@ augroup END
" only do this if autocommands enabled
if has("autocmd")
+ autocmd InsertEnter * :set norelativenumber
+ autocmd InsertLeave * :set relativenumber
+
" enable file type detection and load indent files
filetype plugin indent on
@@ -66,6 +71,10 @@ inoremap <silent><expr> <TAB>
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
+" in normal mode tab key cycles through tabs
+nnoremap <Tab> :tabnext<CR>
+nnoremap <S-Tab> :tabprev<CR>
+
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'