Just a few interesting lines from my ~/.vimrc

linux
vim
config

#1

I think someone could be interested in this:

" Large history
set history=1000

" Save bookmarks in ~/.viminfo
set viminfo='1000,f1

nmap <C-n> :set invnumber<Enter>

" wordwrap
" :set textwidth=79

nmap <C-p> <C-w><C-]><C-w>T

command! CommitPush :!git commit -am fix ; git push origin HEAD
command! TabToSpace :1,$s/\t/    /g
command! Breakpoints :!cat % | perl -ne 'if($_ =~ /^(\w+)\(/) { print "b $1\n"; }'
command! HtmlList :'<,'>s!^\(.*\)$!<li><a href="\1">\1</a>;</li>
command! HtmlListAnchor :'<,'>s!^\(.*\)\s\+\(\S\+\)\s*$!<li><a href="\2">\1</a>;</li>
command! BackupVimrc :!scp ~/.vimrc vpn:.vimrc
command! ReloadVimrc :so $MYVIMRC
command! SpellOn :set spell spelllang=en_us
command! SpellOff :set nospell
command! MarkdownPreview !python3 -m markdown % -f /tmp/1.html && chromium-browser /tmp/1.html
" list global marks
command! Marks :marks ABCDEFGHIJKLMNOPQRSTUVWXYZ<Enter>

set foldmethod=manual

" highlight search string
set hlsearch
" incremental search
set incsearch

" don't clutter your normal directories with *.swp files
set swapfile
set dir=~/temp/vimswap

" highlight trailing spaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
" not good for Python
" match ExtraWhitespace /\([ ]\{4\}\|\s\+$\)/

If you have something interesting in your .vimrc please share!


(Full Snack Developer) #2

I like it! I tend to do all my git work outside my editor these days, but I do miss doing it straight from Spacemacs.

Here’s my .vimrc: https://github.com/bbriggs/dotfiles/blob/master/.config/nvim/init.vim


(system) #3

This topic was automatically closed after 30 days. New replies are no longer allowed.