forked from justone/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
128 lines (94 loc) · 4 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
" Julian Naydichev <[email protected]>
" .vimrc
set nocompatible " necessary to ensure that vim runs as vim
" enable pathogen plugin:
runtime bundle/vim-pathogen/autoload/pathogen.vim
silent! call pathogen#infect()
syntax enable " enable syntax highlighting
filetype plugin indent on " filetype detection: go
set showcmd " display incomplete commands
set showmode " show the current mode
set showmatch " show matching brackets
set backspace=indent,eol,start " intiuitive backspace
set hidden " allow multiple buffers in a better fashion
set wildmenu " command line completion
set wildmode=list:longest " make it like a shell
set ignorecase " case insensitive searching
set smartcase " but smartly
set number " line numbers
set numberwidth=5 " good 'til 99999
set ruler " cursor position
set incsearch " match as you type (searching)
set hlsearch " highlight searches
set wrap " enable line wrapping
set scrolloff=3 " show 3 lines around the cursor
set title " set the terminal's title
set visualbell " no more beeping please
set dir=$HOME/.vim/tmp/,. " keep swap files in one spot
set tabstop=4 " global tab width
set softtabstop=4 " tabs
set shiftwidth=4 " same thing
set expandtab " do I want spaces or tabs?
set autoindent
set laststatus=2 " show status line at all times!
set list " enable showing of tabs
set listchars=tab:>-,trail:- " show tabs and spaces easily
colorscheme vividchalk
set completeopt=menu,longest " improve autocomplete
" FLAGS_SPECIALSAUCE
" thanks to nate for this:
set tags=./tags; " search up our tree for tags
" enable persistent undo
if v:version >= 703
" ensure undo directory exists
if !isdirectory("~/.vimundo")
call system("mkdir ~/.vimundo")
endif
set undodir=~/.vimundo
set undofile
set undolevels=1000
set undoreload=10000
endif
" thank you kaitlyn for the following:
vnoremap C :s/^/#/<CR>:nohl<CR>
" vnoremap c :s/^#//<CR>:nohl<CR> - replaced with the autocmd below
map <leader>nt :NERDTree<CR>
" auto things
autocmd BufNewFile *.php 0r ~/.vim/skeleton/php
autocmd BufNewFile *.pl 0r ~/.vim/skeleton/perl
autocmd BufNewFile *.sh 0r ~/.vim/skeleton/sh
" FuzzyFinder - thanks Nate!
let g:fuf_modesDisable = [ 'mrucmd', ]
let g:fuf_coveragefile_exclude = '\v\~$|blib|\.(o|exe|dll|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])'
let g:fuf_mrufile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)|svn-base$'
let g:fuf_maxMenuWidth = 150
noremap <leader>ff :FufCoverageFile<CR>
noremap <leader>fr :FufMruFile<CR>
noremap <leader>ft :FufTag<CR>
noremap <leader>fb :FufBuffer<CR>
" things I acquired from Damian Conway
"====[ Always turn on syntax highlighting for diffs ]=========================
" use the filetype mechanism to select automatically...
filetype on
augroup PatchDiffHighlight
autocmd!
autocmd FileType diff syntax enable
augroup END
" learn vimscript the hard way
let mapleader='\'
let maplocalleader='_'
" open vimrc, save vimrc
nnoremap <leader>ev :vsplit $MYVIMRC<CR>
nnoremap <leader>sv :source $MYVIMRC<CR>
" quote current word
nnoremap <leader>" viw<esc>a"<esc>hbi"<esc>lel
nnoremap <leader>' viw<esc>a'<esc>hbi'<esc>lel
" insert -> normal mode
inoremap jk <esc>
inoremap <esc> <nop>
" comment magic
autocmd FileType javascript nnoremap <buffer> <localleader>c I//<esc>
autocmd FileType python nnoremap <buffer> <localleader>c I#<esc>
autocmd FileType java nnoremap <buffer> <localleader>c I//<esc>
autocmd FileType perl nnoremap <buffer> <localleader>c I#<esc>
autocmd FileType ruby nnoremap <buffer> <localleader>c I#<esc>