summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.vimrc71
1 files changed, 71 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
new file mode 100644
index 0000000..0494971
--- /dev/null
+++ b/.vimrc
@@ -0,0 +1,71 @@
+set nocompatible
+
+set laststatus=2
+set encoding=utf-8
+set autoindent
+set magic
+set ruler
+set nowrap
+set colorcolumn=+1
+set list listchars=tab:›\ ,extends:→,precedes:←
+set ignorecase
+set smartcase
+set notimeout
+set incsearch
+set showmatch
+set nofoldenable
+set lazyredraw
+set wildmenu
+set spc=
+
+let mapleader = ","
+nnoremap Y y$
+nnoremap <silent><expr> \ (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
+
+inoremap <C-X><C-B> <C-O>:set rl!<CR>
+
+" for the emacsian in me
+nnoremap <C-g> <ESC>
+inoremap <C-g> <ESC>
+vnoremap <C-g> <ESC>
+xnoremap <C-g> <ESC>
+snoremap <C-g> <ESC>
+cnoremap <C-g> <ESC>
+onoremap <C-g> <ESC>
+
+syntax enable
+" highlight StatusLine cterm=none ctermbg=none ctermfg=darkgrey
+" highlight StatusLineNC cterm=none ctermbg=none ctermfg=darkgrey
+highlight ColorColumn ctermbg=black
+
+autocmd FileType text,mail,markdown,rst,gitcommit setlocal tw=70 et ts=2 sw=2
+
+function! ConflictsHighlight() abort
+ syntax region conflictStart start=/^<<<<<<< .*$/ end=/^\ze\(=======$\||||||||\)/
+ syntax region conflictMiddle start=/^||||||| .*$/ end=/^\ze=======$/
+ syntax region conflictEnd start=/^\(=======$\||||||| |\)/ end=/^>>>>>>> .*$/
+
+ highlight conflictStart ctermbg=red ctermfg=black
+ highlight conflictMiddle ctermbg=blue ctermfg=black
+ highlight conflictEnd ctermbg=green cterm=bold ctermfg=black
+endfunction
+
+augroup MyColors
+ autocmd!
+ autocmd BufEnter * call ConflictsHighlight()
+augroup END
+
+" --[ from $VIMRUNTIME/defautls.vim ]--
+" When editing a file, always jump to the last known cursor position.
+" Don't do it when the position is invalid, when inside an event handler
+" (happens when dropping a file on gvim), for a commit or rebase message
+" (likely a different one than last time), and when using xxd(1) to filter
+" and edit binary files (it transforms input files back and forth, causing
+" them to have dual nature, so to speak)
+autocmd BufReadPost *
+ \ let line = line("'\"")
+ \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
+ \ && index(['xxd', 'gitrebase'], &filetype) == -1
+ \ | execute "normal! g`\""
+ \ | endif
+