summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-08-21 09:58:46 -0700
committerBen Sima <ben@bsima.me>2018-08-21 09:58:46 -0700
commitb103278402322fc0af88aba812693f92af316027 (patch)
tree68ef60db010f4340d928d0140cc4a4ed59e5af0f /vimrc
parentf096799004a8549f61dcc1b289d8aa79ee7ea6bd (diff)
Remove sensible and move to vimrc file
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc53
1 files changed, 53 insertions, 0 deletions
diff --git a/vimrc b/vimrc
new file mode 100644
index 0000000..10884b8
--- /dev/null
+++ b/vimrc
@@ -0,0 +1,53 @@
+""" General settings
+set autoindent
+set backspace=indent,eol,start
+set cc=80 " 80 column lines
+set complete-=i " Set the matches for insert mode completion
+set encoding=utf-8 " Set encoding
+set formatoptions+=j " Delete comment character when joining commented lines
+set hlsearch " Highlight all search results
+set incsearch " Incremental search
+set laststatus=1 " No status line
+set linebreak " Break lines at word (requires Wrap lines)
+set ruler " Show line & col number of cursor position
+set shiftwidth=4 " Number of auto-indent spaces
+set showmatch " Highlight matching brace
+set smartcase " Better searching
+set smartindent " Autoindent when starting a new line
+set smarttab " Tab insertion & deletion
+set textwidth=80 " Line wrap (number of cols)
+set visualbell " Use visual bell (no beeping)
+set wildmenu " Helpful completion menu
+
+" Strings to use in 'list' mode and for the :list command
+set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
+
+""" Enable syntax
+if has('syntax') && !exists('g:syntax_on')
+ syntax enable
+endif
+
+""" Mappings
+imap fd <Esc>
+nnoremap ,s :r ~/sig.txt<cr>
+
+" Use <C-L> to clear the highlighting of :set hlsearch.
+if maparg('<C-L>', 'n') ==# ''
+ nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
+endif
+
+""" Easily find cursor with crosshair (\c)
+:hi CursorLine cterm=NONE term=reverse ctermbg=7 guibg=Grey90
+:hi CursorColumn cterm=NONE term=reverse ctermbg=7 guibg=Grey90
+:nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
+
+""" File browser
+let g:netrw_banner=0 " Disable file browser banner
+let g:netrw_liststyle=3 " Tree view
+
+""" CTAGS shortcuts
+" open definition in a new tab:
+map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
+" open definition in a vertical split:
+map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
+