summaryrefslogtreecommitdiff
path: root/solanum/dot_vimrc
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@inria.fr>2020-02-11 16:06:15 +0100
committerAlex Auvolat <alex.auvolat@inria.fr>2020-02-11 16:06:15 +0100
commitf3e78201ed4e30043ee529045f9e1ce23537ec90 (patch)
treef3794b0e99fbbb609c457eb21100e025efb73885 /solanum/dot_vimrc
parent9e00656bd5b3368bdf3b814ee6bce3b6792bfd31 (diff)
downloaduser-config-f3e78201ed4e30043ee529045f9e1ce23537ec90.tar.gz
user-config-f3e78201ed4e30043ee529045f9e1ce23537ec90.zip
Add solanum config
Diffstat (limited to 'solanum/dot_vimrc')
-rw-r--r--solanum/dot_vimrc61
1 files changed, 61 insertions, 0 deletions
diff --git a/solanum/dot_vimrc b/solanum/dot_vimrc
new file mode 100644
index 0000000..be17b3b
--- /dev/null
+++ b/solanum/dot_vimrc
@@ -0,0 +1,61 @@
+source /usr/share/vim/vim82/defaults.vim
+source /etc/vimrc
+
+let NERDTreeIgnore=['\.o$', '\.cmo$', '\.cmx$', '\.cmi$', '\.lib$', '\.pyc$', '^__pycache__$', '\.class$']
+
+set exrc
+set hlsearch
+
+set number
+set relativenumber
+
+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>
+
+" FZF bindings
+" map <leader>f <Esc>:FZF<CR>
+map ; <Esc>:FZF<CR>
+
+map <leader>l <Esc>:ALENextWrap<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>
+
+filetype plugin indent on
+set autoindent
+set smartindent
+set ts=4 sw=4
+
+" indentation for long line wraps
+set wrap
+set linebreak
+set breakindent
+let &showbreak = '> '
+
+set bg=dark
+
+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 trema setl ts=2 sts=2 et
+au FileType trema setl ts=2 sts=2 et
+au FileType typescript.tsx setl ts=2 sts=2 et
+