Share your ~/.vimrc file (was Vim talk slides posted)

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>.

On 14 January 2016 at 10:13, Myles Braithwaite <me@mylesbraithwaite.com> 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>.
I am mostly an Emacs user, and have quite a lot of stuff in $HOME/.emacs.d/init.el I use a system for managing Emacs setup called el-get, by a fellow I often conference with called Dimitri Fontaine. (He also does Postgres and Lisp!) I have a ~/.vim directory, which has nothing in it. The vim config file I didn't realize was there and had interesting contents was $HOME/.viminfo, which seems to have some fascinating history about what things I have edited using vim over the last several years. If you use vim a lot, I'll bet you'll find neat stuff in .viminfo! -- When confronted by a difficult problem, solve it by reducing it to the question, "How would the Lone Ranger handle this?"

Christopher Browne wrote:
Myles Braithwaite <me@mylesbraithwaite.com> wrote:
I'm really interested in other people's setup so could we start a thread of people sharing their ~/.vimrc file. ... I am mostly an Emacs user, and have quite a lot of stuff in $HOME/.emacs.d/init.el
I've noticed over the years that it's mostly been the programmers who are able to do most if not all their work on one system who are able to customize it to the Nth degree. This was even more so back in the day when an attempt to compile GNU Emacs was something people launched over a weekend. Sysadmins and support people usually didn't get the luxury of staying inside their own personalized environment. Ed and vi were what you got on a Unix system in the SysV era; the latter was usually easier to use. Emacs wasn't an easy choice to make until the Linux binary-package era and by then I was too used to vi. (FWIW, I'd first met Emacs on a PR1ME system several years before I met vi, but it was a demo copy we couldn't afford to buy.) I've mostly been doing work that involved logging into a default environment on larger pools of machines over the years (starting back when the better modems were 2400 baud!) and being able to get work done without tweaking the environment first was more of a priority. Dealing with quirks like having to set TERM first, or someone else had picked C Shell or EDITOR=jove as overridden defaults, or Sun putting /opt/wtf/bbq in PATH ahead of saner versions of random tools, or RedHat aliasing common commands to their --with-training-wheels versions, well, after awhile you learn what not to step in. That probably went on a bit long, but the point I was getting at was not forgetting how to drive a default environment.
The vim config file I didn't realize was there and had interesting contents was $HOME/.viminfo, which seems to have some fascinating history about what things I have edited using vim over the last several years. If you use vim a lot, I'll bet you'll find neat stuff in .viminfo!
Or someone doing forensics on you can glean interesting data from that file. Having said that, maybe .bash_history is another file you should glance into... -- Anthony de Boer

On 16-01-14 10:13 AM, 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>.
Wow, that is a long list of stuff in that file. Mine hardly has anything by comparison. I use the following to automatically fix whitespace and de-tabify when editing various source code files. :autocmd BufEnter *.c,*.h,*.cpp,*.php,*.cs set comments=sl:/*,mb:**,elx:* :autocmd BufEnter *.c,*.h,*.cpp,*.php,*.cs,*.py set sts=4 expandtab ts=4 sw=4 :autocmd BufWritePre *.c,*.h,*.cpp,*.php,*.cs,*.py :%s/\s\+$//e :autocmd BufWritePre *.c,*.h,*.cpp,*.php,*.cs,*.py :retab :autocmd BufEnter *.pl,*.py set sts=4 expandtab ts=4 sw=4 :autocmd BufWritePre *.pl,*.py :%s/\s\+$//e :autocmd BufWritePre *.pl,*.py :retab :autocmd BufEnter *.scm set sts=2 expandtab ts=2 sw=2 :autocmd BufWritePre *.scm :%s/\s\+$//e :autocmd BufWritePre *.scm :retab -- Cheers! Kevin. http://www.ve3syb.ca/ |"Nerds make the shiny things that distract Owner of Elecraft K2 #2172 | the mouth-breathers, and that's why we're | powerful!" #include <disclaimer/favourite> | --Chris Hardwick

On Thu 14 Jan 2016 14:02 -0500, Kevin Cozens wrote:
On 16-01-14 10:13 AM, 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>.
Wow, that is a long list of stuff in that file. Mine hardly has anything by comparison. I use the following to automatically fix whitespace and de-tabify when editing various source code files.
I think sharing a whole vimrc is a bit much to digest but these are a couple settings I enjoy: " case insensitive search set ignorecase " exact matching if pattern contains an Upper case char set smartcase " hilite search results set hlsearch highlight Search ctermfg=black ctermbg=yellow " Don't like people determining how my editor behaves set nomodeline

As for my .vimrc settings, I shortened my .vimrc by moving several settings to external files: set nocompatible behave xterm filetype plugin indent on syntax on source $HOME/.vim/vimrc/filetypes.vim source $HOME/.vim/vimrc/looks.vim source $HOME/.vim/vimrc/mappings.vim source $HOME/.vim/vimrc/misc.vim source $HOME/.vim/vimrc/plugin_configs.vim source $HOME/.vim/vimrc/plugins.vim source $HOME/.vim/vimrc/settings.vim source $HOME/.vim/vimrc/spelling.vim " Source a local vimrc if it exists if filereadable(expand("$HOME/.vimrc.local")) source $HOME/.vimrc.local endif On 14 Jan 2016 at 10:13, Myles Braithwaite wrote: <snip>

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@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
participants (7)
-
Anthony de Boer
-
Christopher Browne
-
Kevin Cozens
-
Loui Chang
-
Michael Galea
-
Myles Braithwaite
-
Paul King