[GTALUG] Share your ~/.vimrc file (was Vim talk slides posted)
Michael Galea
mgalea at #grendel.galea.lan
Sat Jan 16 18:26:00 UTC 2016
On Thu, Jan 14, 2016 at 10:13:47AM -0500, Myles Braithwaite wrote:
> I'm really interested in other people's setup so could we start a
> thread of people sharing their ~/.vimrc file.
>
> Here is mine: <https://github.com/myles/dotfiles/blob/master/vimrc>.
>
> And if you are interested in the vim plugins I use:
> <https://github.com/myles/dotfiles/blob/master/vimrc.bundles>.
> ---
> Talk Mailing List
> talk at gtalug.org
> https://gtalug.org/mailman/listinfo/talk
" .vimrc
" activate syntax highlighting
syntax on
" use better colours on a dark background
set background=dark
" put up a title of the file's name
"set title
" use indents of 4 spaces, and have them copied down lines:
set autoindent
set softtabstop=4
"To set the mod-N indentation used when you hit the tab key in vim (what Emacs calls c-basic-indent), do this:
set shiftwidth=4
"To cause the TAB file-character to be displayed as mod-N in vi and vim (what Emacs calls tab-width), do this:
set tabstop=4
"
" make searches case-insensitive, unless they contain upper-case letters:
set ignorecase
set smartcase
"
" show the `best match so far' as search strings are typed:
set incsearch
"
" assume the /g flag on :s substitutions to replace all matches in a line:
set gdefault
"
" map f12 to allow turning on and off of syntax on/off
set pastetoggle=<f12>
" Resume editing from last known line
set viminfo='10,\"100,:20,%,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
" Map F11 to Run make and if it errors then wait for a CR before returning
map <F11> :wa<CR>:make<CR>
" Map CTRL Arrrow to switch between buffers..
map <C-Up> <c-w>k
map <C-Down> <c-w>j
" Allow processing of modelines!
set modeline
" Show trailing whitespace:
:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+$/
" Collapse stupid File/Author/Copyright Blocks
" Remember that zc closes the block..
:set foldmethod=marker
" In order to paste a keystroke such as 'return', use "CTRL-v CTRL-m"..
"command and action in Visual Block Mode
"c change selection (delete and switch to insert mode)
"I insert in front of cursor
"A append after cursor
"r replace every character in selection
"d delete selection
"o toggle cursor to opposite corner
" Add this to the end of source files to force formatting!
" # vim:ts=4:sw=4:
--
Michael Galea
More information about the talk
mailing list