summaryrefslogtreecommitdiff
path: root/kusanagi/dot_vimrc
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-23 20:13:32 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-23 20:13:32 +0100
commitdb61f6d0a707750fbc650b80d605b818bbcaf708 (patch)
treedd2eacffa3474ec4838f5a151fd79e5f6381d433 /kusanagi/dot_vimrc
parent2acee2bb448d2a9a5e70d862c114cb58206beae4 (diff)
downloaduser-config-db61f6d0a707750fbc650b80d605b818bbcaf708.tar.gz
user-config-db61f6d0a707750fbc650b80d605b818bbcaf708.zip
Update kusanagi config
Diffstat (limited to 'kusanagi/dot_vimrc')
-rw-r--r--kusanagi/dot_vimrc106
1 files changed, 106 insertions, 0 deletions
diff --git a/kusanagi/dot_vimrc b/kusanagi/dot_vimrc
new file mode 100644
index 0000000..e8dbcf0
--- /dev/null
+++ b/kusanagi/dot_vimrc
@@ -0,0 +1,106 @@
+" ============== KEY MAPPINGS
+
+let mapleader=","
+
+" Tab modes.
+map <leader>m <Esc>:set expandtab ts=2 sw=2 sts=2<CR>
+map <leader>t <Esc>:set noexpandtab ts=4 sw=4 sts=4<CR>
+map <leader>T <Esc>:set expandtab ts=4 sw=4 sts=4<CR>
+
+" Folds:
+" map <leader>f <Esc>:set fen fdn=3 fdm=indent fml=1 fdc=3<CR>
+
+map ; <ESC>:FZF<CR>
+
+" H-L for next-prev buffer
+nnoremap <leader>l :bnext<CR>
+nnoremap <leader>k :bprev<CR>
+
+
+
+" Append modeline after last line in buffer.
+" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX
+" files.
+function! AppendModeline()
+ let l:modeline = printf(" vim: set sts=%d ts=%d sw=%d tw=%d %set :",
+ \ &softtabstop, &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
+ let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
+ call append(line("$"), l:modeline)
+endfunction
+nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
+
+
+" =================== OPTIONS
+
+" colorscheme slate
+
+filetype plugin indent on
+set autoindent
+set ts=4 sw=4
+
+" Controls
+set mouse=a
+set nostartofline
+set wildmode=list:longest
+
+" Display
+highlight SpellBad ctermfg=red ctermbg=none
+set bg=dark
+set hlsearch
+set incsearch
+syntax on
+set lazyredraw
+set number
+set relativenumber
+set showcmd
+set shortmess=a
+set display+=lastline
+
+" indentation for long line wraps
+set wrap
+set linebreak
+set breakindent
+let &showbreak = '> '
+
+" set cursorline
+" hi CursorLine cterm=bold ctermbg=0
+" hi Folded ctermfg=2 ctermbg=0
+" hi FoldColumn ctermfg=2 ctermbg=0
+
+let g:sclangTerm = "urxvt -e"
+
+let NERDTreeIgnore=['\.o$', '\.cmo$', '\.cmx$', '\.cmi$', '\.lib$', '\.pyc$', '^__pycache__$']
+
+" set completeopt=menuone,menu,longest,preview
+
+set undofile
+set directory=~/.vim/swp
+set backupdir=~/.vim/backup
+set undodir=~/.vim/undo
+
+" =========== FILE TYPE SPECIFIC
+
+au BufRead,BufNewFile *.make set filetype=make
+au BufRead,BufNewFile *.md set filetype=markdown
+au BufRead,BufNewFile *.lus set filetype=lustre
+au BufRead,BufNewFile *.scade set filetype=scade
+
+au FileType make setl noexpandtab
+au FileType python setl sw=4 sts=4 et
+au FileType html setl sw=2 sts=2 et
+au FileType htmldjango setl sw=2 sts=2 et
+au FileType json setl sw=2 sts=2 et
+au FileType javascript setl sw=2 sts=2 et
+au FileType yaml setl sw=2 sts=2 et
+au FileType css setl sw=4 sts=4 et
+au FileType lua setl ts=4 sw=4 noet
+au FileType elixir setl sw=2 sts=2 et
+
+autocmd FileType tex setlocal spell spelllang=en
+
+" Packs
+
+packloadall
+silent! helptags ALL
+
+