Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 1154 lines (1004 sloc) 46.445 kb
bbd971d @spf13 Adding .vimrc file
authored
1 " Modeline and Notes {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
2 " vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
bbd971d @spf13 Adding .vimrc file
authored
3 "
50a9e10 @parherman more tidying of .vimrc file
parherman authored
4 " __ _ _____ _
5 " ___ _ __ / _/ |___ / __ __(_)_ __ ___
6 " / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \
7 " \__ \ |_) | _| |___) |_____|\ V / | | | | | | |
8 " |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|
9 " |_|
10 "
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
11 " This is the personal .vimrc file of Steve Francia.
12 " While much of it is beneficial for general use, I would
13 " recommend picking out the parts you want and understand.
bbd971d @spf13 Adding .vimrc file
authored
14 "
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
15 " You can find me at http://spf13.com
4229220 @spf13 Adopting the Apache 2 License. Fixed #653
authored
16 "
17 " Copyright 2014 Steve Francia
18 "
19 " Licensed under the Apache License, Version 2.0 (the "License");
20 " you may not use this file except in compliance with the License.
21 " You may obtain a copy of the License at
22 "
23 " http://www.apache.org/licenses/LICENSE-2.0
24 "
25 " Unless required by applicable law or agreed to in writing, software
26 " distributed under the License is distributed on an "AS IS" BASIS,
27 " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 " See the License for the specific language governing permissions and
29 " limitations under the License.
bbd971d @spf13 Adding .vimrc file
authored
30 " }
31
b01ec59 @spf13 Cleaning up vimrc file, adding better term support
authored
32 " Environment {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
33
47547b8 @johntyree Use platform identify functions
johntyree authored
34 " Identify platform {
35 silent function! OSX()
36 return has('macunix')
37 endfunction
38 silent function! LINUX()
39 return has('unix') && !has('macunix') && !has('win32unix')
40 endfunction
41 silent function! WINDOWS()
6a8e1b8 @spf13 Better windows detection
authored
42 return (has('win16') || has('win32') || has('win64'))
47547b8 @johntyree Use platform identify functions
johntyree authored
43 endfunction
44 " }
45
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
46 " Basics {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
47 set nocompatible " Must be first line
47547b8 @johntyree Use platform identify functions
johntyree authored
48 if !WINDOWS()
47380d8 Don't set shell to /bin/sh on Windows. Setting the shell to sh on Window...
ljani authored
49 set shell=/bin/sh
50 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
51 " }
52
53 " Windows Compatible {
54 " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
11080ca @stephpy Use if executable, if there is no ctags, not install tagbar bundle, idem...
stephpy authored
55 " across (heterogeneous) systems easier.
47547b8 @johntyree Use platform identify functions
johntyree authored
56 if WINDOWS()
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
57 set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
58 endif
59 " }
ef2b479 @mmikitka Applied Sass filetype temporary workaround. Waiting on permanent fix to ...
mmikitka authored
60
3f2a3c3 @johntyree Source before config after environment and essentials are set up
johntyree authored
61 " }
3b8307b Fixed order to work on windows again
Richard Bateman authored
62
3f2a3c3 @johntyree Source before config after environment and essentials are set up
johntyree authored
63 " Use before config if available {
64 if filereadable(expand("~/.vimrc.before"))
65 source ~/.vimrc.before
66 endif
7ec2e1f @spf13 tidying up .vimrc file after merge with taxilian
authored
67 " }
5f7b2a4 @spf13 Organized the .vimrc a bit
authored
68
bf4d838 @sbennett18 Remove redundant sourcing
sbennett18 authored
69 " Use bundles config {
70 if filereadable(expand("~/.vimrc.bundles"))
71 source ~/.vimrc.bundles
72 endif
da6fa0c @spf13 more migration to vundle
authored
73 " }
74
bbd971d @spf13 Adding .vimrc file
authored
75 " General {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
76
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
77 set background=dark " Assume a dark background
e477f03 @johntyree Why is this here?
johntyree authored
78 " if !has('gui')
9a2af6a @spf13 More work on readme file (adding images).
authored
79 "set term=$TERM " Make arrow and other keys work
e477f03 @johntyree Why is this here?
johntyree authored
80 " endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
81 filetype plugin indent on " Automatically detect file types.
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
82 syntax on " Syntax highlighting
83 set mouse=a " Automatically enable mouse usage
84 set mousehide " Hide the mouse cursor while typing
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
85 scriptencoding utf-8
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
86
c5addb9 @johntyree Better clipboard testing
johntyree authored
87 if has('clipboard')
5f6b198 @johntyree Fix test for 'unnamedplus' again...
johntyree authored
88 if has('unnamedplus') " When possible use + register for copy-paste
107b93b @spf13 Some improvements to clipboard support
authored
89 set clipboard=unnamed,unnamedplus
c5addb9 @johntyree Better clipboard testing
johntyree authored
90 else " On mac and Windows, use * register for copy-paste
91 set clipboard=unnamed
92 endif
fe6ea83 @spf13 Fixing issue #201.. using clipboard as register
authored
93 endif
94
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
95 " Most prefer to automatically switch to the current file directory when
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
96 " a new buffer is opened; to prevent this behavior, add the following to
0240f11 @spf13 before -> before.local & adding before.fork
authored
97 " your .vimrc.before.local file:
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
98 " let g:spf13_no_autochdir = 1
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
99 if !exists('g:spf13_no_autochdir')
100 autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
101 " Always switch to the current file directory
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
102 endif
7ec2e1f @spf13 tidying up .vimrc file after merge with taxilian
authored
103
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
104 "set autowrite " Automatically write a file when leaving a modified buffer
105 set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter')
106 set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
107 set virtualedit=onemore " Allow for cursor beyond last character
108 set history=1000 " Store a ton of history (default is 20)
109 set spell " Spell checking on
110 set hidden " Allow buffer switching without saving
49e1bcf @spf13 Fixed #617. period is now an end of word designator
authored
111 set iskeyword-=. " '.' is an end of word designator
21ff737 @spf13 fixed #547. Better end of word handling.
authored
112 set iskeyword-=# " '#' is an end of word designator
113 set iskeyword-=- " '-' is an end of word designator
2a7bd2b @spf13 grouping bundles, fixing term setting in .vimrc
authored
114
1eb005b @keelerm84 Issue #341 Cursor on first line for git commit msg
keelerm84 authored
115 " Instead of reverting the cursor to the last position in the buffer, we
116 " set it to the first line when editing a git commit message
117 au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
118
85909e3 @perfectworks auto restore cursor to last edit position when open file
perfectworks authored
119 " http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
120 " Restore cursor to file position in previous editing session
121 " To disable this, add the following to your .vimrc.before.local file:
122 " let g:spf13_no_restore_cursor = 1
123 if !exists('g:spf13_no_restore_cursor')
124 function! ResCur()
125 if line("'\"") <= line("$")
126 normal! g`"
127 return 1
128 endif
129 endfunction
130
131 augroup resCur
132 autocmd!
133 autocmd BufWinEnter * call ResCur()
134 augroup END
135 endif
136
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
137 " Setting up the directories {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
138 set backup " Backups are nice ...
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
139 if has('persistent_undo')
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
140 set undofile " So is persistent undo ...
141 set undolevels=1000 " Maximum number of changes that can be undone
142 set undoreload=10000 " Maximum number lines to save for undo on a buffer reload
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
143 endif
a4b6652 Allow users to disable views.
Chad Metcalf authored
144
0240f11 @spf13 before -> before.local & adding before.fork
authored
145 " To disable views add the following to your .vimrc.before.local file:
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
146 " let g:spf13_no_views = 1
147 if !exists('g:spf13_no_views')
148 " Add exclusions to mkview and loadview
149 " eg: *.*, svn-commit.tmp
150 let g:skipview_files = [
151 \ '\[example pattern\]'
152 \ ]
153 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
154 " }
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
155
bbd971d @spf13 Adding .vimrc file
authored
156 " }
157
158 " Vim UI {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
159
11dda52 @drake01 added check for override_spf13_bundles in vimrc
drake01 authored
160 if !exists('g:override_spf13_bundles') && filereadable(expand("~/.vim/bundle/vim-colors-solarized/colors/solarized.vim"))
de87ad9 @jejansse Fixed wrong positioning of termcolors argument of solarize, leading to w...
jejansse authored
161 let g:solarized_termcolors=256
c9e09d2 @spf13 add support for local bundles, general .vimrc and readme cleanup
authored
162 let g:solarized_termtrans=1
97906e8 @teasp00n Changed solarized options from high to normal. These are the tested defa...
teasp00n authored
163 let g:solarized_contrast="normal"
164 let g:solarized_visibility="normal"
c6014b9 @sbennett18 Fix solarized if statement
sbennett18 authored
165 color solarized " Load a colorscheme
166 endif
167
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
168 set tabpagemax=15 " Only show 15 tabs
169 set showmode " Display the current mode
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
170
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
171 set cursorline " Highlight current line
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
172
4b254f8 @mhinz Add vim-signify; remove vim-gitgutter
mhinz authored
173 highlight clear SignColumn " SignColumn should match background
174 highlight clear LineNr " Current line number row will have same background color in relative mode
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
175 "highlight clear CursorLineNr " Remove highlight color from current line number
5c9b68e @jcbwlkr vim-gitgutter highlighting
jcbwlkr authored
176
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
177 if has('cmdline_info')
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
178 set ruler " Show the ruler
179 set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids
180 set showcmd " Show partial commands in status line and
181 " Selected characters/lines in visual mode
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
182 endif
183
184 if has('statusline')
7ec2e1f @spf13 tidying up .vimrc file after merge with taxilian
authored
185 set laststatus=2
3e1585c @spf13 Improving the status line, moving phpComplete setting to piv plugin
authored
186
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
187 " Broken down into easily includeable segments
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
188 set statusline=%<%f\ " Filename
189 set statusline+=%w%h%m%r " Options
11dda52 @drake01 added check for override_spf13_bundles in vimrc
drake01 authored
190 if !exists('g:override_spf13_bundles')
191 set statusline+=%{fugitive#statusline()} " Git Hotness
192 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
193 set statusline+=\ [%{&ff}/%Y] " Filetype
194 set statusline+=\ [%{getcwd()}] " Current dir
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
195 set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
196 endif
197
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
198 set backspace=indent,eol,start " Backspace for dummies
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
199 set linespace=0 " No extra spaces between rows
32b6565 @itchyny Fix abbreviation of option name for readability
itchyny authored
200 set number " Line numbers on
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
201 set showmatch " Show matching brackets/parenthesis
202 set incsearch " Find as you type search
203 set hlsearch " Highlight search terms
204 set winminheight=0 " Windows can be 0 line high
205 set ignorecase " Case insensitive search
206 set smartcase " Case sensitive when uc present
207 set wildmenu " Show list instead of just completing
208 set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all.
209 set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
210 set scrolljump=5 " Lines to scroll when cursor leaves screen
211 set scrolloff=3 " Minimum lines to keep above and below cursor
212 set foldenable " Auto fold code
13744bd @spf13 a few small tweeks to .vimrc file
authored
213 set list
987f6df @spf13 Better highlighting of tabs and trailing spaces
authored
214 set listchars=tab:\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
13744bd @spf13 a few small tweeks to .vimrc file
authored
215
bbd971d @spf13 Adding .vimrc file
authored
216 " }
217
218 " Formatting {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
219
b76c81a @swapnilmj Updated description of nowrap command
swapnilmj authored
220 set nowrap " Do not wrap long lines
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
221 set autoindent " Indent at the same level of the previous line
222 set shiftwidth=4 " Use indents of 4 spaces
223 set expandtab " Tabs are spaces, not tabs
224 set tabstop=4 " An indentation every four columns
225 set softtabstop=4 " Let backspace delete indent
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
226 set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
227 set splitright " Puts new vsplit windows to the right of the current
228 set splitbelow " Puts new split windows to the bottom of the current
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
229 "set matchpairs+=<:> " Match, to be used with %
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
230 set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
231 "set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
232 " Remove trailing whitespaces and ^M chars
f7453a0 @johntyree Move test for whitespace stripping out of function.
johntyree authored
233 " To disable the stripping of whitespace, add the following to your
234 " .vimrc.before.local file:
235 " let g:spf13_keep_trailing_whitespace = 1
7f6b867 @edi9999 Update .vimrc
edi9999 authored
236 autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre <buffer> if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif
3d430e5 @spf13 Moving go support to fatih/vim-go
authored
237 "autocmd FileType go autocmd BufWritePre <buffer> Fmt
96df5cf @jdewit Added beyondwords/vim-twig bundle
jdewit authored
238 autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
a570c9b @globin improve rust and puppet support
globin authored
239 autocmd FileType haskell,puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
240 " preceding line best in a plugin but here for now.
cdf22ab @spf13 Merge branch '3.0' of https://github.com/victoredwardocallaghan/spf13-vi...
authored
241
40a65a0 @spf13 Add support for detecting .coffee files.
authored
242 autocmd BufNewFile,BufRead *.coffee set filetype=coffee
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
243
00a06cf @victoredwardocallaghan Haskell: Improve indent and comment support, fix spelling highlighting i...
victoredwardocallaghan authored
244 " Workaround vim-commentary for Haskell
245 autocmd FileType haskell setlocal commentstring=--\ %s
246 " Workaround broken colour highlighting in Haskell
a570c9b @globin improve rust and puppet support
globin authored
247 autocmd FileType haskell,rust setlocal nospell
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
248
bbd971d @spf13 Adding .vimrc file
authored
249 " }
250
7ec2e1f @spf13 tidying up .vimrc file after merge with taxilian
authored
251 " Key (re)Mappings {
bbd971d @spf13 Adding .vimrc file
authored
252
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
253 " The default leader is '\', but many people prefer ',' as it's in a standard
254 " location. To override this behavior and set it back to '\' (or any other
0240f11 @spf13 before -> before.local & adding before.fork
authored
255 " character) add the following to your .vimrc.before.local file:
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
256 " let g:spf13_leader='\'
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
257 if !exists('g:spf13_leader')
258 let mapleader = ','
259 else
260 let mapleader=g:spf13_leader
261 endif
127a75b @johntyree Map localleader to _
johntyree authored
262 if !exists('g:spf13_localleader')
263 let maplocalleader = '_'
264 else
265 let maplocalleader=g:spf13_localleader
266 endif
ada9062 @spf13 mapping leader to ,
authored
267
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
268 " Easier moving in tabs and windows
182afa3 @jamestomasino adding fix to override easy-window bindings
jamestomasino authored
269 " The lines conflict with the default digraph mapping of <C-K>
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
270 " If you prefer that functionality, add the following to your
271 " .vimrc.before.local file:
272 " let g:spf13_no_easyWindows = 1
182afa3 @jamestomasino adding fix to override easy-window bindings
jamestomasino authored
273 if !exists('g:spf13_no_easyWindows')
274 map <C-J> <C-W>j<C-W>_
275 map <C-K> <C-W>k<C-W>_
276 map <C-L> <C-W>l<C-W>_
277 map <C-H> <C-W>h<C-W>_
278 endif
b75110b @spf13 Merged in Taxilians stuff and cleaned it up a bit
authored
279
13744bd @spf13 a few small tweeks to .vimrc file
authored
280 " Wrapped lines goes down/up to next row, rather than next line in file.
bd6fe25 Expect j and k to behave consistently in normal, visual, operator and se...
ljani authored
281 noremap j gj
282 noremap k gk
13744bd @spf13 a few small tweeks to .vimrc file
authored
283
33091b2 @lukedomanski added spf13 option to enable/disable wrap relative movement mappings
lukedomanski authored
284 " End/Start of line motion keys act relative to row/wrap width in the
285 " presence of `:set wrap`, and relative to line for `:set nowrap`.
286 " Default vim behaviour is to act relative to text line in both cases
287 " If you prefer the default behaviour, add the following to your
288 " .vimrc.before.local file:
289 " let g:spf13_no_wrapRelMotion = 1
290 if !exists('g:spf13_no_wrapRelMotion')
291 " Same for 0, home, end, etc
292 function! WrapRelativeMotion(key, ...)
293 let vis_sel=""
294 if a:0
295 let vis_sel="gv"
296 endif
297 if &wrap
298 execute "normal!" vis_sel . "g" . a:key
299 else
300 execute "normal!" vis_sel . a:key
301 endif
302 endfunction
303
7b21d20 @lukedomanski fixed wrap relative motion mappings to address problem reported in spf13...
lukedomanski authored
304 " Map g* keys in Normal, Operator-pending, and Visual+select
4122da2 @lukedomanski rolled back some changes to ensure d0 and d^ match default behaviours, s...
lukedomanski authored
305 noremap $ :call WrapRelativeMotion("$")<CR>
306 noremap <End> :call WrapRelativeMotion("$")<CR>
307 noremap 0 :call WrapRelativeMotion("0")<CR>
308 noremap <Home> :call WrapRelativeMotion("0")<CR>
309 noremap ^ :call WrapRelativeMotion("^")<CR>
310 " Overwrite the operator pending $/<End> mappings from above
311 " to force inclusive motion with :execute normal!
7b21d20 @lukedomanski fixed wrap relative motion mappings to address problem reported in spf13...
lukedomanski authored
312 onoremap $ v:call WrapRelativeMotion("$")<CR>
313 onoremap <End> v:call WrapRelativeMotion("$")<CR>
4122da2 @lukedomanski rolled back some changes to ensure d0 and d^ match default behaviours, s...
lukedomanski authored
314 " Overwrite the Visual+select mode mappings from above
315 " to ensure the correct vis_sel flag is passed to function
33091b2 @lukedomanski added spf13 option to enable/disable wrap relative movement mappings
lukedomanski authored
316 vnoremap $ :<C-U>call WrapRelativeMotion("$", 1)<CR>
317 vnoremap <End> :<C-U>call WrapRelativeMotion("$", 1)<CR>
318 vnoremap 0 :<C-U>call WrapRelativeMotion("0", 1)<CR>
319 vnoremap <Home> :<C-U>call WrapRelativeMotion("0", 1)<CR>
320 vnoremap ^ :<C-U>call WrapRelativeMotion("^", 1)<CR>
321 endif
bdf475e @memotype Add other g* commands to go with gj, gk, etc.
memotype authored
322
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
323 " The following two lines conflict with moving to top and
324 " bottom of the screen
325 " If you prefer that functionality, add the following to your
0240f11 @spf13 before -> before.local & adding before.fork
authored
326 " .vimrc.before.local file:
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
327 " let g:spf13_no_fastTabs = 1
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
328 if !exists('g:spf13_no_fastTabs')
329 map <S-H> gT
330 map <S-L> gt
7b0ef43 @spf13 Improving the typo handling of common commands
authored
331 endif
332
811dc59 @taxilian Add additional options to be disable-able
taxilian authored
333 " Stupid shift key fixes
334 if !exists('g:spf13_no_keyfixes')
335 if has("user_commands")
336 command! -bang -nargs=* -complete=file E e<bang> <args>
337 command! -bang -nargs=* -complete=file W w<bang> <args>
338 command! -bang -nargs=* -complete=file Wq wq<bang> <args>
339 command! -bang -nargs=* -complete=file WQ wq<bang> <args>
340 command! -bang Wa wa<bang>
341 command! -bang WA wa<bang>
342 command! -bang Q q<bang>
343 command! -bang QA qa<bang>
344 command! -bang Qa qa<bang>
345 endif
346
347 cmap Tabe tabe
348 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
349
350 " Yank from the cursor to the end of the line, to be consistent with C and D.
351 nnoremap Y y$
b75110b @spf13 Merged in Taxilians stuff and cleaned it up a bit
authored
352
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
353 " Code folding options
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
354 nmap <leader>f0 :set foldlevel=0<CR>
355 nmap <leader>f1 :set foldlevel=1<CR>
356 nmap <leader>f2 :set foldlevel=2<CR>
357 nmap <leader>f3 :set foldlevel=3<CR>
358 nmap <leader>f4 :set foldlevel=4<CR>
359 nmap <leader>f5 :set foldlevel=5<CR>
360 nmap <leader>f6 :set foldlevel=6<CR>
361 nmap <leader>f7 :set foldlevel=7<CR>
362 nmap <leader>f8 :set foldlevel=8<CR>
363 nmap <leader>f9 :set foldlevel=9<CR>
83b27da @spf13 updated mappings, fixed broken links in readme, updated children
authored
364
96678bc @ajitsing some useful mappings I use everyday
ajitsing authored
365 "UPPERCASE and lowsercase conversion
366 nnoremap g^ gUiW
367 nnoremap gv guiW
368
369 "go to first and last char of line
6ddb460 @spf13 You can't add comments to the tail of a remap line
authored
370 nnoremap H ^
371 nnoremap L g_
96678bc @ajitsing some useful mappings I use everyday
ajitsing authored
372 vnoremap H ^
373 vnoremap L g_
374
476e275 @sbennett18 Option to clear instead of toggle search highlighting
sbennett18 authored
375 " Most prefer to toggle search highlighting rather than clear the current
376 " search results. To clear search highlighting rather than toggle it on
377 " and off, add the following to your .vimrc.before.local file:
378 " let g:spf13_clear_search_highlight = 1
379 if exists('g:spf13_clear_search_highlight')
380 nmap <silent> <leader>/ :nohlsearch<CR>
381 else
382 nmap <silent> <leader>/ :set invhlsearch<CR>
383 endif
384
13744bd @spf13 a few small tweeks to .vimrc file
authored
385
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
386 " Find merge conflict markers
387 map <leader>fc /\v^[<\|=>]{7}( .*\|$)<CR>
388
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
389 " Shortcuts
390 " Change Working Directory to that of the current file
83b27da @spf13 updated mappings, fixed broken links in readme, updated children
authored
391 cmap cwd lcd %:p:h
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
392 cmap cd. lcd %:p:h
393
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
394 " Visual shifting (does not exit Visual mode)
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
395 vnoremap < <gv
11080ca @stephpy Use if executable, if there is no ctags, not install tagbar bundle, idem...
stephpy authored
396 vnoremap > >gv
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
397
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
398 " Allow using the repeat operator with a visual selection (!)
399 " http://stackoverflow.com/a/8064607/127816
400 vnoremap . :normal .<CR>
401
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
402 " For when you forget to sudo.. Really Write the file.
403 cmap w!! w !sudo tee % >/dev/null
c9e09d2 @spf13 add support for local bundles, general .vimrc and readme cleanup
authored
404
405 " Some helpers to edit mode
406 " http://vimcasts.org/e/14
366e81d @regedor Fixed edit shortcuts for paths containing spaces
regedor authored
407 cnoremap %% <C-R>=fnameescape(expand('%:h')).'/'<cr>
c9e09d2 @spf13 add support for local bundles, general .vimrc and readme cleanup
authored
408 map <leader>ew :e %%
409 map <leader>es :sp %%
410 map <leader>ev :vsp %%
411 map <leader>et :tabe %%
412
413 " Adjust viewports to the same size
414 map <Leader>= <C-w>=
52f92d5 @phaikawl easier horizontal scrolling
phaikawl authored
415
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
416 " Map <Leader>ff to display all lines with keyword under cursor
f1efa72 @jamestomasino Added cross buffer search with <leader>f
jamestomasino authored
417 " and ask which one to jump to
64cc46c @perfectworks MOD: use <leader>ff instead <leader>f
perfectworks authored
418 nmap <Leader>ff [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
f1efa72 @jamestomasino Added cross buffer search with <leader>f
jamestomasino authored
419
52f92d5 @phaikawl easier horizontal scrolling
phaikawl authored
420 " Easier horizontal scrolling
421 map zl zL
422 map zh zH
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
423
ae2fe5a @spf13 Adding a set of bundles for Writing in Vim
authored
424 " Easier formatting
425 nnoremap <silent> <leader>q gwip
426
3e793d3 @johntyree Add note to fixup FullScreen map
johntyree authored
427 " FIXME: Revert this f70be548
f70be54 @JoveYu add fullscreen mode for GVIM and Terminal
JoveYu authored
428 " fullscreen mode for GVIM and Terminal, need 'wmctrl' in you PATH
429 map <silent> <F11> :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")<CR>
430
bbd971d @spf13 Adding .vimrc file
authored
431 " }
432
433 " Plugins {
434
ae2fe5a @spf13 Adding a set of bundles for Writing in Vim
authored
435 " TextObj Sentence {
436 if count(g:spf13_bundle_groups, 'writing')
437 augroup textobj_sentence
438 autocmd!
439 autocmd FileType markdown call textobj#sentence#init()
440 autocmd FileType textile call textobj#sentence#init()
441 autocmd FileType text call textobj#sentence#init()
442 augroup END
443 endif
444 " }
445
446 " TextObj Quote {
447 if count(g:spf13_bundle_groups, 'writing')
448 augroup textobj_quote
449 autocmd!
450 autocmd FileType markdown call textobj#quote#init()
451 autocmd FileType textile call textobj#quote#init()
452 autocmd FileType text call textobj#quote#init({'educate': 0})
453 augroup END
454 endif
455 " }
456
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
457 " PIV {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
458 if isdirectory(expand("~/.vim/bundle/PIV"))
459 let g:DisableAutoPHPFolding = 0
460 let g:PIVAutoClose = 0
461 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
462 " }
bf166b1 @spf13 fixing sparkup's horrible default keymaps
authored
463
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
464 " Misc {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
465 if isdirectory(expand("~/.vim/bundle/nerdtree"))
466 let g:NERDShutUp=1
467 endif
468 if isdirectory(expand("~/.vim/bundle/matchit.zip"))
469 let b:match_ignorecase = 1
470 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
471 " }
472
473 " OmniComplete {
4ec01f5 @perfectworks add a switch to disable omni complete
perfectworks authored
474 " To disable omni complete, add the following to your .vimrc.before.local file:
475 " let g:spf13_no_omni_complete = 1
476 if !exists('g:spf13_no_omni_complete')
477 if has("autocmd") && exists("+omnifunc")
478 autocmd Filetype *
479 \if &omnifunc == "" |
480 \setlocal omnifunc=syntaxcomplete#Complete |
481 \endif
482 endif
bbd971d @spf13 Adding .vimrc file
authored
483
4ec01f5 @perfectworks add a switch to disable omni complete
perfectworks authored
484 hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
485 hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
486 hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
487
488 " Some convenient mappings
489 inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
412556c @chrisnicola Don't remap <CR> for omnicomplete it causes issues
chrisnicola authored
490 if exists('g:spf13_map_cr_omni_complete')
491 inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
492 endif
4ec01f5 @perfectworks add a switch to disable omni complete
perfectworks authored
493 inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
494 inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
495 inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
496 inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
497
498 " Automatically open and close the popup menu / preview window
499 au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
500 set completeopt=menu,preview,longest
501 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
502 " }
bf166b1 @spf13 fixing sparkup's horrible default keymaps
authored
503
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
504 " Ctags {
505 set tags=./tags;/,~/.vimtags
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
506
507 " Make tags placed in .git/tags file available in all levels of a repository
508 let gitroot = substitute(system('git rev-parse --show-toplevel'), '[\n\r]', '', 'g')
509 if gitroot != ''
510 let &tags = &tags . ',' . gitroot . '/.git/tags'
511 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
512 " }
a44447d @spf13 adding better tag support
authored
513
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
514 " AutoCloseTag {
183f0f2 @spf13 switching to garbas snipmate, using <leader>ac to toggle autoclose plugi...
authored
515 " Make it so AutoCloseTag works for xml and xhtml files as well
516 au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
517 nmap <Leader>ac <Plug>ToggleAutoCloseMappings
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
518 " }
bbd971d @spf13 Adding .vimrc file
authored
519
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
520 " SnipMate {
521 " Setting the author var
7ec2e1f @spf13 tidying up .vimrc file after merge with taxilian
authored
522 " If forking, please overwrite in your .vimrc.local file
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
523 let g:snips_author = 'Steve Francia <steve.francia@gmail.com>'
524 " }
525
526 " NerdTree {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
527 if isdirectory(expand("~/.vim/bundle/nerdtree"))
528 map <C-e> <plug>NERDTreeTabsToggle<CR>
529 map <leader>e :NERDTreeFind<CR>
530 nmap <leader>nt :NERDTreeFind<CR>
531
532 let NERDTreeShowBookmarks=1
c0865eb @cupen Fixed regex of `NERDTreeIgnore`.
cupen authored
533 let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
534 let NERDTreeChDirMode=0
535 let NERDTreeQuitOnOpen=1
536 let NERDTreeMouseMode=2
537 let NERDTreeShowHidden=1
538 let NERDTreeKeepTreeInNewTab=1
539 let g:nerdtree_tabs_open_on_gui_startup=0
540 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
541 " }
bf166b1 @spf13 fixing sparkup's horrible default keymaps
authored
542
2b3d2e9 @spf13 adding tabularize shortcuts to .vimrc
authored
543 " Tabularize {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
544 if isdirectory(expand("~/.vim/bundle/tabular"))
545 nmap <Leader>a& :Tabularize /&<CR>
546 vmap <Leader>a& :Tabularize /&<CR>
095a23c @jazmit Changed `<Leader>a=` to only align one `=` sign
jazmit authored
547 nmap <Leader>a= :Tabularize /^[^=]*\zs=<CR>
548 vmap <Leader>a= :Tabularize /^[^=]*\zs=<CR>
a570c9b @globin improve rust and puppet support
globin authored
549 nmap <Leader>a=> :Tabularize /=><CR>
550 vmap <Leader>a=> :Tabularize /=><CR>
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
551 nmap <Leader>a: :Tabularize /:<CR>
552 vmap <Leader>a: :Tabularize /:<CR>
553 nmap <Leader>a:: :Tabularize /:\zs<CR>
554 vmap <Leader>a:: :Tabularize /:\zs<CR>
555 nmap <Leader>a, :Tabularize /,<CR>
556 vmap <Leader>a, :Tabularize /,<CR>
557 nmap <Leader>a,, :Tabularize /,\zs<CR>
558 vmap <Leader>a,, :Tabularize /,\zs<CR>
559 nmap <Leader>a<Bar> :Tabularize /<Bar><CR>
560 vmap <Leader>a<Bar> :Tabularize /<Bar><CR>
561 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
562 " }
2b3d2e9 @spf13 adding tabularize shortcuts to .vimrc
authored
563
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
564 " Session List {
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
565 set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
566 if isdirectory(expand("~/.vim/bundle/sessionman.vim/"))
567 nmap <leader>sl :SessionList<CR>
568 nmap <leader>ss :SessionSave<CR>
569 nmap <leader>sc :SessionClose<CR>
570 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
571 " }
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
572
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
573 " JSON {
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
574 nmap <leader>jt <Esc>:%!python -m json.tool<CR><Esc>:set filetype=json<CR>
a570c9b @globin improve rust and puppet support
globin authored
575 let g:vim_json_syntax_conceal = 0
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
576 " }
95b7ab5 @spf13 Adding neocomplcache and python-mode plugins & config
authored
577
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
578 " PyMode {
c0cfed3 fix PyMode setting; add ctrlp-funky
yushijun authored
579 " Disable if python support not present
580 if !has('python')
581 let g:pymode = 0
582 endif
583
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
584 if isdirectory(expand("~/.vim/bundle/python-mode"))
585 let g:pymode_lint_checkers = ['pyflakes']
586 let g:pymode_trim_whitespaces = 0
587 let g:pymode_options = 0
588 let g:pymode_rope = 0
589 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
590 " }
95b7ab5 @spf13 Adding neocomplcache and python-mode plugins & config
authored
591
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
592 " ctrlp {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
593 if isdirectory(expand("~/.vim/bundle/ctrlp.vim/"))
594 let g:ctrlp_working_path_mode = 'ra'
595 nnoremap <silent> <D-t> :CtrlP<CR>
596 nnoremap <silent> <D-r> :CtrlPMRU<CR>
597 let g:ctrlp_custom_ignore = {
598 \ 'dir': '\.git$\|\.hg$\|\.svn$',
599 \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' }
600
601 " On Windows use "dir" as fallback command.
602 if WINDOWS()
603 let s:ctrlp_fallback = 'dir %s /-n /b /s /a-d'
604 elseif executable('ag')
605 let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""'
606 elseif executable('ack-grep')
607 let s:ctrlp_fallback = 'ack-grep %s --nocolor -f'
608 elseif executable('ack')
609 let s:ctrlp_fallback = 'ack %s --nocolor -f'
610 else
611 let s:ctrlp_fallback = 'find %s -type f'
612 endif
86003ba @spf13 Fixing error message on startup
authored
613 if exists("g:ctrlp_user_command")
614 unlet g:ctrlp_user_command
615 endif
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
616 let g:ctrlp_user_command = {
617 \ 'types': {
618 \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
619 \ 2: ['.hg', 'hg --cwd %s locate -I .'],
620 \ },
621 \ 'fallback': s:ctrlp_fallback
622 \ }
623
624 if isdirectory(expand("~/.vim/bundle/ctrlp-funky/"))
625 " CtrlP extensions
626 let g:ctrlp_extensions = ['funky']
627
628 "funky
629 nnoremap <Leader>fu :CtrlPFunky<Cr>
630 endif
43bfb4f @nesmyslny On Windows, the fallback command (g:ctrlp_user_command) should be "dir" ...
nesmyslny authored
631 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
632 "}
c9e09d2 @spf13 add support for local bundles, general .vimrc and readme cleanup
authored
633
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
634 " TagBar {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
635 if isdirectory(expand("~/.vim/bundle/tagbar/"))
636 nnoremap <silent> <leader>tt :TagbarToggle<CR>
637 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
638 "}
c9e09d2 @spf13 add support for local bundles, general .vimrc and readme cleanup
authored
639
de66798 @spf13 Make vim startup without error message when python isn't present
authored
640
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
641 " Fugitive {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
642 if isdirectory(expand("~/.vim/bundle/vim-fugitive/"))
643 nnoremap <silent> <leader>gs :Gstatus<CR>
644 nnoremap <silent> <leader>gd :Gdiff<CR>
645 nnoremap <silent> <leader>gc :Gcommit<CR>
646 nnoremap <silent> <leader>gb :Gblame<CR>
647 nnoremap <silent> <leader>gl :Glog<CR>
648 nnoremap <silent> <leader>gp :Git push<CR>
649 nnoremap <silent> <leader>gr :Gread<CR>
650 nnoremap <silent> <leader>gw :Gwrite<CR>
651 nnoremap <silent> <leader>ge :Gedit<CR>
652 " Mnemonic _i_nteractive
653 nnoremap <silent> <leader>gi :Git add -p %<CR>
654 nnoremap <silent> <leader>gg :SignifyToggle<CR>
655 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
656 "}
a6c6647 @rekendahl Screen program mapping is now opt-in
rekendahl authored
657
b36d049 @teasp00n Added YouCompleteMe configuration block. Ultisnips now default snippet
teasp00n authored
658 " YouCompleteMe {
659 if count(g:spf13_bundle_groups, 'youcompleteme')
660 let g:acp_enableAtStartup = 0
661
e715394 @teasp00n Remapped default snippet expansion and movement options for ultisnips.
teasp00n authored
662 " enable completion from tags
663 let g:ycm_collect_identifiers_from_tags_files = 1
b36d049 @teasp00n Added YouCompleteMe configuration block. Ultisnips now default snippet
teasp00n authored
664
e715394 @teasp00n Remapped default snippet expansion and movement options for ultisnips.
teasp00n authored
665 " remap Ultisnips for compatibility for YCM
666 let g:UltiSnipsExpandTrigger = '<C-j>'
667 let g:UltiSnipsJumpForwardTrigger = '<C-j>'
668 let g:UltiSnipsJumpBackwardTrigger = '<C-k>'
a6c6647 @rekendahl Screen program mapping is now opt-in
rekendahl authored
669
b36d049 @teasp00n Added YouCompleteMe configuration block. Ultisnips now default snippet
teasp00n authored
670 " Enable omni completion.
671 autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
672 autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
673 autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
674 autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
675 autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
676 autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
677 autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
678
679 " Haskell post write lint and check with ghcmod
680 " $ `cabal install ghcmod` if missing and ensure
681 " ~/.cabal/bin is in your $PATH.
682 if !executable("ghcmod")
683 autocmd BufWritePost *.hs GhcModCheckAndLintAsync
684 endif
685
686 " For snippet_complete marker.
47d7952 @julianduque Fix no_conceal on youcompleteme
julianduque authored
687 if !exists("g:spf13_no_conceal")
688 if has('conceal')
689 set conceallevel=2 concealcursor=i
690 endif
b36d049 @teasp00n Added YouCompleteMe configuration block. Ultisnips now default snippet
teasp00n authored
691 endif
692
693 " Disable the neosnippet preview candidate window
694 " When enabled, there can be too much visual noise
695 " especially when splits are used.
696 set completeopt-=preview
697 endif
698 " }
0e0d125 @spf13 A ton of changes, a few new plugins, removing a few old ones... prepping...
authored
699
0a14e18 added support for neocomplete
Anthony Carathimas authored
700 " neocomplete {
701 if count(g:spf13_bundle_groups, 'neocomplete')
702 let g:acp_enableAtStartup = 0
2051b16 Fixed neocomplete configuration according to the migration guide: https:...
ljani authored
703 let g:neocomplete#enable_at_startup = 1
704 let g:neocomplete#enable_smart_case = 1
705 let g:neocomplete#enable_auto_delimiter = 1
706 let g:neocomplete#max_list = 15
707 let g:neocomplete#force_overwrite_completefunc = 1
0a14e18 added support for neocomplete
Anthony Carathimas authored
708
709
710 " Define dictionary.
2051b16 Fixed neocomplete configuration according to the migration guide: https:...
ljani authored
711 let g:neocomplete#sources#dictionary#dictionaries = {
0a14e18 added support for neocomplete
Anthony Carathimas authored
712 \ 'default' : '',
713 \ 'vimshell' : $HOME.'/.vimshell_hist',
714 \ 'scheme' : $HOME.'/.gosh_completions'
715 \ }
716
717 " Define keyword.
2051b16 Fixed neocomplete configuration according to the migration guide: https:...
ljani authored
718 if !exists('g:neocomplete#keyword_patterns')
719 let g:neocomplete#keyword_patterns = {}
0a14e18 added support for neocomplete
Anthony Carathimas authored
720 endif
2051b16 Fixed neocomplete configuration according to the migration guide: https:...
ljani authored
721 let g:neocomplete#keyword_patterns['default'] = '\h\w*'
0a14e18 added support for neocomplete
Anthony Carathimas authored
722
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
723 " Plugin key-mappings {
724 " These two lines conflict with the default digraph mapping of <C-K>
725 if !exists('g:spf13_no_neosnippet_expand')
726 imap <C-k> <Plug>(neosnippet_expand_or_jump)
727 smap <C-k> <Plug>(neosnippet_expand_or_jump)
728 endif
0b0cb19 @johntyree Add less invasive completion mappings
johntyree authored
729 if exists('g:spf13_noninvasive_completion')
a299f31 @wolfgangpfnuer replace iunmap <CR> with inoremap <CR> <CR>
wolfgangpfnuer authored
730 inoremap <CR> <CR>
0b0cb19 @johntyree Add less invasive completion mappings
johntyree authored
731 " <ESC> takes you out of insert mode
732 inoremap <expr> <Esc> pumvisible() ? "\<C-y>\<Esc>" : "\<Esc>"
733 " <CR> accepts first, then sends the <CR>
734 inoremap <expr> <CR> pumvisible() ? "\<C-y>\<CR>" : "\<CR>"
735 " <Down> and <Up> cycle like <Tab> and <S-Tab>
736 inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
737 inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
738 " Jump up and down the list
739 inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
740 inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
741 else
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
742 " <C-k> Complete Snippet
743 " <C-k> Jump to next snippet point
0b0cb19 @johntyree Add less invasive completion mappings
johntyree authored
744 imap <silent><expr><C-k> neosnippet#expandable() ?
745 \ "\<Plug>(neosnippet_expand_or_jump)" : (pumvisible() ?
90f6428 @yssource try to fix #526 issue 1, prevent "<C-k>" from invoking its self looply.
yssource authored
746 \ "\<C-e>" : "\<Plug>(neosnippet_expand_or_jump)")
0b0cb19 @johntyree Add less invasive completion mappings
johntyree authored
747 smap <TAB> <Right><Plug>(neosnippet_jump_or_expand)
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
748
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
749 inoremap <expr><C-g> neocomplete#undo_completion()
750 inoremap <expr><C-l> neocomplete#complete_common_string()
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
751 "inoremap <expr><CR> neocomplete#complete_common_string()
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
752
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
753 " <CR>: close popup
754 " <s-CR>: close popup and save indent.
c9e5c9d @louispan fixed missing . in <S-CR> bindings
louispan authored
755 inoremap <expr><s-CR> pumvisible() ? neocomplete#smart_close_popup()."\<CR>" : "\<CR>"
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
756
757 function! CleverCr()
758 if pumvisible()
759 if neosnippet#expandable()
760 let exp = "\<Plug>(neosnippet_expand)"
40b91a6 @spf13 Better handling of neocomplete closing.
authored
761 return exp . neocomplete#smart_close_popup()
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
762 else
40b91a6 @spf13 Better handling of neocomplete closing.
authored
763 return neocomplete#smart_close_popup()
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
764 endif
765 else
766 return "\<CR>"
767 endif
768 endfunction
769
1ca8fe0 @leowzukw Remove traillings
leowzukw authored
770 " <CR> close popup and save indent or expand snippet
771 imap <expr> <CR> CleverCr()
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
772 " <C-h>, <BS>: close popup and delete backword char.
773 inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
40b91a6 @spf13 Better handling of neocomplete closing.
authored
774 inoremap <expr><C-y> neocomplete#smart_close_popup()
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
775 endif
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
776 " <TAB>: completion.
777 inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
778 inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
779
780 " Courtesy of Matteo Cavalleri
781
782 function! CleverTab()
783 if pumvisible()
784 return "\<C-n>"
a570c9b @globin improve rust and puppet support
globin authored
785 endif
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
786 let substr = strpart(getline('.'), 0, col('.') - 1)
787 let substr = matchstr(substr, '[^ \t]*$')
788 if strlen(substr) == 0
789 " nothing to match on empty string
790 return "\<Tab>"
791 else
792 " existing text matching
793 if neosnippet#expandable_or_jumpable()
794 return "\<Plug>(neosnippet_expand_or_jump)"
795 else
796 return neocomplete#start_manual_complete()
797 endif
798 endif
799 endfunction
800
801 imap <expr> <Tab> CleverTab()
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
802 " }
0a14e18 added support for neocomplete
Anthony Carathimas authored
803
804 " Enable heavy omni completion.
2051b16 Fixed neocomplete configuration according to the migration guide: https:...
ljani authored
805 if !exists('g:neocomplete#sources#omni#input_patterns')
806 let g:neocomplete#sources#omni#input_patterns = {}
0a14e18 added support for neocomplete
Anthony Carathimas authored
807 endif
2051b16 Fixed neocomplete configuration according to the migration guide: https:...
ljani authored
808 let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
809 let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
810 let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
811 let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
812 let g:neocomplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
0a14e18 added support for neocomplete
Anthony Carathimas authored
813 " }
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
814 " neocomplcache {
0d0e6dd @johntyree Avoid duplication between neocomplete and neocomplcache
johntyree authored
815 elseif count(g:spf13_bundle_groups, 'neocomplcache')
5ffcbcf @perfectworks skip neocomplcache configure if use snipmate
perfectworks authored
816 let g:acp_enableAtStartup = 0
817 let g:neocomplcache_enable_at_startup = 1
818 let g:neocomplcache_enable_camel_case_completion = 1
819 let g:neocomplcache_enable_smart_case = 1
820 let g:neocomplcache_enable_underbar_completion = 1
821 let g:neocomplcache_enable_auto_delimiter = 1
822 let g:neocomplcache_max_list = 15
823 let g:neocomplcache_force_overwrite_completefunc = 1
824
825 " Define dictionary.
826 let g:neocomplcache_dictionary_filetype_lists = {
827 \ 'default' : '',
828 \ 'vimshell' : $HOME.'/.vimshell_hist',
829 \ 'scheme' : $HOME.'/.gosh_completions'
830 \ }
831
832 " Define keyword.
833 if !exists('g:neocomplcache_keyword_patterns')
834 let g:neocomplcache_keyword_patterns = {}
835 endif
836 let g:neocomplcache_keyword_patterns._ = '\h\w*'
837
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
838 " Plugin key-mappings {
839 " These two lines conflict with the default digraph mapping of <C-K>
ad9739f @johntyree Add less invasive completion mappings (neocomplcache)
johntyree authored
840 imap <C-k> <Plug>(neosnippet_expand_or_jump)
841 smap <C-k> <Plug>(neosnippet_expand_or_jump)
842 if exists('g:spf13_noninvasive_completion')
a299f31 @wolfgangpfnuer replace iunmap <CR> with inoremap <CR> <CR>
wolfgangpfnuer authored
843 inoremap <CR> <CR>
ad9739f @johntyree Add less invasive completion mappings (neocomplcache)
johntyree authored
844 " <ESC> takes you out of insert mode
845 inoremap <expr> <Esc> pumvisible() ? "\<C-y>\<Esc>" : "\<Esc>"
846 " <CR> accepts first, then sends the <CR>
847 inoremap <expr> <CR> pumvisible() ? "\<C-y>\<CR>" : "\<CR>"
848 " <Down> and <Up> cycle like <Tab> and <S-Tab>
849 inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
850 inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
851 " Jump up and down the list
852 inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
853 inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
854 else
855 imap <silent><expr><C-k> neosnippet#expandable() ?
856 \ "\<Plug>(neosnippet_expand_or_jump)" : (pumvisible() ?
90f6428 @yssource try to fix #526 issue 1, prevent "<C-k>" from invoking its self looply.
yssource authored
857 \ "\<C-e>" : "\<Plug>(neosnippet_expand_or_jump)")
ad9739f @johntyree Add less invasive completion mappings (neocomplcache)
johntyree authored
858 smap <TAB> <Right><Plug>(neosnippet_jump_or_expand)
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
859
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
860 inoremap <expr><C-g> neocomplcache#undo_completion()
861 inoremap <expr><C-l> neocomplcache#complete_common_string()
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
862 "inoremap <expr><CR> neocomplcache#complete_common_string()
863
864 function! CleverCr()
865 if pumvisible()
866 if neosnippet#expandable()
867 let exp = "\<Plug>(neosnippet_expand)"
868 return exp . neocomplcache#close_popup()
869 else
870 return neocomplcache#close_popup()
871 endif
872 else
873 return "\<CR>"
874 endif
875 endfunction
876
1ca8fe0 @leowzukw Remove traillings
leowzukw authored
877 " <CR> close popup and save indent or expand snippet
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
878 imap <expr> <CR> CleverCr()
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
879
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
880 " <CR>: close popup
881 " <s-CR>: close popup and save indent.
c9e5c9d @louispan fixed missing . in <S-CR> bindings
louispan authored
882 inoremap <expr><s-CR> pumvisible() ? neocomplcache#close_popup()."\<CR>" : "\<CR>"
ae9c9fd @spf13 Better <CR> and <Tab> handling when popup menu is present for autocomple...
authored
883 "inoremap <expr><CR> pumvisible() ? neocomplcache#close_popup() : "\<CR>"
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
884
2f3df05 @johntyree Wrap neocompl supertab emulation in conditionals. Add to vimrc.before
johntyree authored
885 " <C-h>, <BS>: close popup and delete backword char.
886 inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
887 inoremap <expr><C-y> neocomplcache#close_popup()
6c379d3 @sbennett18 Update some formatting
sbennett18 authored
888 endif
889 " <TAB>: completion.
890 inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
891 inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
892 " }
5ffcbcf @perfectworks skip neocomplcache configure if use snipmate
perfectworks authored
893
894 " Enable omni completion.
895 autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
896 autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
897 autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
898 autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
899 autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
900 autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
86c946c @victoredwardocallaghan autocmd lines should be moved to the .vimrc file as per advice from spf1...
victoredwardocallaghan authored
901 autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
5ffcbcf @perfectworks skip neocomplcache configure if use snipmate
perfectworks authored
902
903 " Enable heavy omni completion.
904 if !exists('g:neocomplcache_omni_patterns')
905 let g:neocomplcache_omni_patterns = {}
906 endif
907 let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
908 let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
909 let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
910 let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
911 let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
3b6eab1 @pjvds Add neocomplcache_omni_patterns for Go
pjvds authored
912 let g:neocomplcache_omni_patterns.go = '\h\w*\.\?'
0d0e6dd @johntyree Avoid duplication between neocomplete and neocomplcache
johntyree authored
913 " }
914 " Normal Vim omni-completion {
4ec01f5 @perfectworks add a switch to disable omni complete
perfectworks authored
915 " To disable omni complete, add the following to your .vimrc.before.local file:
916 " let g:spf13_no_omni_complete = 1
917 elseif !exists('g:spf13_no_omni_complete')
0d0e6dd @johntyree Avoid duplication between neocomplete and neocomplcache
johntyree authored
918 " Enable omni-completion.
919 autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
920 autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
921 autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
922 autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
923 autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
924 autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
925 autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
926
927 endif
928 " }
929
930 " Snippets {
931 if count(g:spf13_bundle_groups, 'neocomplcache') ||
932 \ count(g:spf13_bundle_groups, 'neocomplete')
5ffcbcf @perfectworks skip neocomplcache configure if use snipmate
perfectworks authored
933
934 " Use honza's snippets.
935 let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
936
937 " Enable neosnippet snipmate compatibility mode
938 let g:neosnippet#enable_snipmate_compatibility = 1
939
940 " For snippet_complete marker.
7460001 @johntyree Add spf13_no_conceal
johntyree authored
941 if !exists("g:spf13_no_conceal")
942 if has('conceal')
943 set conceallevel=2 concealcursor=i
944 endif
5ffcbcf @perfectworks skip neocomplcache configure if use snipmate
perfectworks authored
945 endif
946
2be7e68 @spf13 Enable snippets in go when using neosnippet
authored
947 " Enable neosnippets when using go
948 let g:go_snippet_engine = "neosnippet"
949
5ffcbcf @perfectworks skip neocomplcache configure if use snipmate
perfectworks authored
950 " Disable the neosnippet preview candidate window
951 " When enabled, there can be too much visual noise
952 " especially when splits are used.
953 set completeopt-=preview
8d0096f @jphustman Tab S-Tab neocomplcache
jphustman authored
954 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
955 " }
95b7ab5 @spf13 Adding neocomplcache and python-mode plugins & config
authored
956
0d0e6dd @johntyree Avoid duplication between neocomplete and neocomplcache
johntyree authored
957 " FIXME: Isn't this for Syntastic to handle?
958 " Haskell post write lint and check with ghcmod
959 " $ `cabal install ghcmod` if missing and ensure
960 " ~/.cabal/bin is in your $PATH.
961 if !executable("ghcmod")
962 autocmd BufWritePost *.hs GhcModCheckAndLintAsync
963 endif
964
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
965 " UndoTree {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
966 if isdirectory(expand("~/.vim/bundle/undotree/"))
967 nnoremap <Leader>u :UndotreeToggle<CR>
968 " If undotree is opened, it is likely one wants to interact with it.
969 let g:undotree_SetFocusWhenToggle=1
970 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
971 " }
c9e09d2 @spf13 add support for local bundles, general .vimrc and readme cleanup
authored
972
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
973 " indent_guides {
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
974 if isdirectory(expand("~/.vim/bundle/vim-indent-guides/"))
975 let g:indent_guides_start_level = 2
976 let g:indent_guides_guide_size = 1
977 let g:indent_guides_enable_on_vim_startup = 1
978 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
979 " }
a959b20 @JoveYu add indent_guides
JoveYu authored
980
c60f84a @spf13 Adding wildfire support.. Hit return to use it.
authored
981 " Wildfire {
982 let g:wildfire_objects = {
983 \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"],
984 \ "html,xml" : ["at"],
985 \ }
986 " }
987
2fa6d2b @jcbwlkr Update airline documentation
jcbwlkr authored
988 " vim-airline {
989 " Set configuration options for the statusline plugin vim-airline.
990 " Use the powerline theme and optionally enable powerline symbols.
991 " To use the symbols , , , , , , and .in the statusline
992 " segments add the following to your .vimrc.before.local file:
993 " let g:airline_powerline_fonts=1
994 " If the previous symbols do not render for you then install a
995 " powerline enabled font.
beb8fd5 @johntyree airline_theme can be set from .vimrc.local
johntyree authored
996
997 " See `:echo g:airline_theme_map` for some more choices
998 " Default in terminal vim is 'dark'
ccb87f5 @nmacinnis check for plugin existence before setting options, mappings, etc
nmacinnis authored
999 if isdirectory(expand("~/.vim/bundle/vim-airline/"))
1000 if !exists('g:airline_theme')
1001 let g:airline_theme = 'solarized'
1002 endif
1003 if !exists('g:airline_powerline_fonts')
1004 " Use the default set of separators with a few customizations
1005 let g:airline_left_sep='›' " Slightly fancier than '>'
1006 let g:airline_right_sep='‹' " Slightly fancier than '<'
1007 endif
0e5414e @SaswatPadhi Conditionally override airline separators only if powerline fonts are no...
SaswatPadhi authored
1008 endif
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
1009 " }
1010
bbd971d @spf13 Adding .vimrc file
authored
1011 " }
1012
1013 " GUI Settings {
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1014
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
1015 " GVIM- (here instead of .gvimrc)
1016 if has('gui_running')
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1017 set guioptions-=T " Remove the toolbar
bf836fd @sbennett18 Remove unnecessary/extra ts, sw, et directives
sbennett18 authored
1018 set lines=40 " 40 lines of text instead of 24
da6c930 @johntyree Add spf13_no_big_font
johntyree authored
1019 if !exists("g:spf13_no_big_font")
1020 if LINUX() && has("gui_running")
391f61a @spf13 fixed #474 . Smaller default font on gvim
authored
1021 set guifont=Andale\ Mono\ Regular\ 12,Menlo\ Regular\ 11,Consolas\ Regular\ 12,Courier\ New\ Regular\ 14
da6c930 @johntyree Add spf13_no_big_font
johntyree authored
1022 elseif OSX() && has("gui_running")
391f61a @spf13 fixed #474 . Smaller default font on gvim
authored
1023 set guifont=Andale\ Mono\ Regular:h12,Menlo\ Regular:h11,Consolas\ Regular:h12,Courier\ New\ Regular:h14
da6c930 @johntyree Add spf13_no_big_font
johntyree authored
1024 elseif WINDOWS() && has("gui_running")
1025 set guifont=Andale_Mono:h10,Menlo:h10,Consolas:h10,Courier_New:h10
1026 endif
28a11e4 Add guifont format for gtk2
Gerard (Gerry) Caulfield authored
1027 endif
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
1028 else
fe4f97d Fix CSApprox when run inside xterm or screen/tmux
Gerard (Gerry) Caulfield authored
1029 if &term == 'xterm' || &term == 'screen'
bf836fd @sbennett18 Remove unnecessary/extra ts, sw, et directives
sbennett18 authored
1030 set t_Co=256 " Enable 256 colors to stop the CSApprox warning and make xterm vim shine
fe4f97d Fix CSApprox when run inside xterm or screen/tmux
Gerard (Gerry) Caulfield authored
1031 endif
9a2af6a @spf13 More work on readme file (adding images).
authored
1032 "set term=builtin_ansi " Make arrow and other keys work
ba0cc62 @taxilian Cleanup of spacing, removed a few defunct config sections
taxilian authored
1033 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1034
bbd971d @spf13 Adding .vimrc file
authored
1035 " }
249b444 @taxilian Added some tweaks for NERDtree
taxilian authored
1036
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1037 " Functions {
bf166b1 @spf13 fixing sparkup's horrible default keymaps
authored
1038
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1039 " Initialize directories {
1040 function! InitializeDirectories()
1041 let parent = $HOME
1042 let prefix = 'vim'
1043 let dir_list = {
1044 \ 'backup': 'backupdir',
1045 \ 'views': 'viewdir',
1046 \ 'swap': 'directory' }
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
1047
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1048 if has('persistent_undo')
1049 let dir_list['undo'] = 'undodir'
1050 endif
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
1051
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1052 " To specify a different directory in which to place the vimbackup,
1053 " vimviews, vimundo, and vimswap files/directories, add the following to
a8c04ef @sbennett18 Populate .vimrc.before with all spf13 options
sbennett18 authored
1054 " your .vimrc.before.local file:
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1055 " let g:spf13_consolidated_directory = <full path to desired directory>
1056 " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/'
1057 if exists('g:spf13_consolidated_directory')
1058 let common_dir = g:spf13_consolidated_directory . prefix
1059 else
1060 let common_dir = parent . '/.' . prefix
1061 endif
7e37213 @sbennett18 Customizable backup/swap/undo/views location
sbennett18 authored
1062
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1063 for [dirname, settingname] in items(dir_list)
1064 let directory = common_dir . dirname . '/'
1065 if exists("*mkdir")
1066 if !isdirectory(directory)
1067 call mkdir(directory)
1068 endif
1069 endif
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
1070 if !isdirectory(directory)
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1071 echo "Warning: Unable to create backup directory: " . directory
1072 echo "Try: mkdir -p " . directory
1073 else
1074 let directory = substitute(directory, " ", "\\\\ ", "g")
1075 exec "set " . settingname . "=" . directory
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
1076 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1077 endfor
1078 endfunction
a8c04ef @sbennett18 Populate .vimrc.before with all spf13 options
sbennett18 authored
1079 call InitializeDirectories()
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1080 " }
1081
1082 " Initialize NERDTree as needed {
1083 function! NERDTreeInitAsNeeded()
1084 redir => bufoutput
1085 buffers!
1086 redir END
1087 let idx = stridx(bufoutput, "NERD_tree")
1088 if idx > -1
1089 NERDTreeMirror
1090 NERDTreeFind
1091 wincmd l
d3d0a71 @parherman don't use persistent undo it's not available
parherman authored
1092 endif
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1093 endfunction
1094 " }
1095
1096 " Strip whitespace {
1097 function! StripTrailingWhitespace()
f7453a0 @johntyree Move test for whitespace stripping out of function.
johntyree authored
1098 " Preparation: save last search, and cursor position.
1099 let _s=@/
1100 let l = line(".")
1101 let c = col(".")
1102 " do the business:
1103 %s/\s\+$//e
1104 " clean up: restore previous search history, and cursor position
1105 let @/=_s
1106 call cursor(l, c)
2e10470 @sbennett18 Normalize formatting and fix comments
sbennett18 authored
1107 endfunction
1108 " }
2def0bc @johntyree Replace slow whitespace trim autocmd.
johntyree authored
1109
6a7c01d @sbennett18 Add various useful commands
sbennett18 authored
1110 " Shell command {
1111 function! s:RunShellCommand(cmdline)
1112 botright new
1113
1114 setlocal buftype=nofile
1115 setlocal bufhidden=delete
1116 setlocal nobuflisted
1117 setlocal noswapfile
1118 setlocal nowrap
1119 setlocal filetype=shell
1120 setlocal syntax=shell
1121
1122 call setline(1, a:cmdline)
1123 call setline(2, substitute(a:cmdline, '.', '=', 'g'))
1124 execute 'silent $read !' . escape(a:cmdline, '%#')
1125 setlocal nomodifiable
1126 1
1127 endfunction
1128
1129 command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
1130 " e.g. Grep current file for <search_term>: Shell grep -Hn <search_term> %
1131 " }
1132
bf166b1 @spf13 fixing sparkup's horrible default keymaps
authored
1133 " }
f74cd3f @bloveridge source a user's ~/.vimrc.local if it exists
bloveridge authored
1134
85a6b2d @taxilian Add support for .fork customizations
taxilian authored
1135 " Use fork vimrc if available {
1136 if filereadable(expand("~/.vimrc.fork"))
a04cf40 @taxilian Add fork bundle include to .vimrc.bundle
taxilian authored
1137 source ~/.vimrc.fork
85a6b2d @taxilian Add support for .fork customizations
taxilian authored
1138 endif
1139 " }
8d0096f @jphustman Tab S-Tab neocomplcache
jphustman authored
1140
f74cd3f @bloveridge source a user's ~/.vimrc.local if it exists
bloveridge authored
1141 " Use local vimrc if available {
1142 if filereadable(expand("~/.vimrc.local"))
1143 source ~/.vimrc.local
1144 endif
1145 " }
bfef2ff @munkt0n added check for gui_running and availability of .gvimrc.local
munkt0n authored
1146
1147 " Use local gvimrc if available and gui is running {
11080ca @stephpy Use if executable, if there is no ctags, not install tagbar bundle, idem...
stephpy authored
1148 if has('gui_running')
1149 if filereadable(expand("~/.gvimrc.local"))
bfef2ff @munkt0n added check for gui_running and availability of .gvimrc.local
munkt0n authored
1150 source ~/.gvimrc.local
1151 endif
1152 endif
d376639 @spf13 Merge branch '3.0' of github.com:spf13/spf13-vim into 3.0
authored
1153 " }
Something went wrong with that request. Please try again.