X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/26064f9fa3af5e8e46eb4560f4145386c056821e..d88c507b0c8f204b82702693a249bf1b88c342e9:/vimrc?ds=inline diff --git a/vimrc b/vimrc index 53183df..baf2aed 100644 --- a/vimrc +++ b/vimrc @@ -95,8 +95,10 @@ if has("autocmd") " (happens when dropping a file on gvim). " Also don't do it when the mark is in the first line, that is the default " position when opening a file. + " blacklist certain filetype, you can get a file type with :echo &ft + let blacklist = ['gitcommit'] autocmd BufReadPost * - \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ if index(blacklist, &ft) < 0 && line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif @@ -140,6 +142,8 @@ set shiftwidth=4 set expandtab set showbreak=▒▒ +" show these chars for tabs and trailing spaces +set list listchars=tab:»·,trail:· set pastetoggle= " split right when using :vsp @@ -151,6 +155,17 @@ imap ii " Press `` to toggle insert and replace mode (no key on Mac keyboard) imap `` +" fold between {{{ }}} +set foldmethod=marker +set foldlevelstart=99 +" space will toggle current fold in normal mode, if not in a fold, normal +" behaviour +nnoremap @=(foldlevel('.')?'za':"\") +vnoremap zf +" save and restore folds +autocmd BufWinLeave *.* mkview +autocmd BufWinEnter *.* silent loadview + " Jump to the next or previous line that has the same level or a lower " level of indentation than the current line. "