vim .vimrc 开发配置方案

🌙
手机阅读
本文目录结构
  1. " Modeline and Notes {
  2. " vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
  3. "
  4. " __ _ _____ _
  5. " ___ _ __ / _/ |___ / __ __(_)_ __ ___
  6. " / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \
  7. " \__ \ |_) | _| |___) |_____|\ V / | | | | | | |
  8. " |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|
  9. " |_|
  10. "
  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.
  14. "
  15. " You can find me at http://spf13.com
  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.
  30. " }
  31. " Environment {
  32. " Identify platform {
  33. silent function! OSX()
  34. return has('macunix')
  35. endfunction
  36. silent function! LINUX()
  37. return has('unix') && !has('macunix') && !has('win32unix')
  38. endfunction
  39. silent function! WINDOWS()
  40. return (has('win32') || has('win64'))
  41. endfunction
  42. " }
  43. " Basics {
  44. set nocompatible " Must be first line
  45. if !WINDOWS()
  46. set shell=/bin/sh
  47. endif
  48. " }
  49. " Windows Compatible {
  50. " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
  51. " across (heterogeneous) systems easier.
  52. if WINDOWS()
  53. set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
  54. endif
  55. " }
  56. " Arrow Key Fix {
  57. " https://github.com/spf13/spf13-vim/issues/780
  58. if &term[:4] == "xterm" || &term[:5] == 'screen' || &term[:3] == 'rxvt'
  59. inoremap OC
  60. endif
  61. " }
  62. " }
  63. " Use before config if available {
  64. if filereadable(expand("~/.vimrc.before"))
  65. source ~/.vimrc.before
  66. endif
  67. " }
  68. " Use bundles config {
  69. if filereadable(expand("~/.vimrc.bundles"))
  70. source ~/.vimrc.bundles
  71. endif
  72. " }
  73. " General {
  74. set background=dark " Assume a dark background
  75. " Allow to trigger background
  76. function! ToggleBG()
  77. let s:tbg = &background
  78. " Inversion
  79. if s:tbg == "dark"
  80. set background=light
  81. else
  82. set background=dark
  83. endif
  84. endfunction
  85. noremap bg :call ToggleBG()
  86. " if !has('gui')
  87. "set term=$TERM " Make arrow and other keys work
  88. " endif
  89. filetype plugin indent on " Automatically detect file types.
  90. syntax on " Syntax highlighting
  91. set mouse=a " Automatically enable mouse usage
  92. set mousehide " Hide the mouse cursor while typing
  93. scriptencoding utf-8
  94. if has('clipboard')
  95. if has('unnamedplus') " When possible use + register for copy-paste
  96. set clipboard=unnamed,unnamedplus
  97. else " On mac and Windows, use * register for copy-paste
  98. set clipboard=unnamed
  99. endif
  100. endif
  101. " Most prefer to automatically switch to the current file directory when
  102. " a new buffer is opened; to prevent this behavior, add the following to
  103. " your .vimrc.before.local file:
  104. " let g:spf13_no_autochdir = 1
  105. if !exists('g:spf13_no_autochdir')
  106. autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
  107. " Always switch to the current file directory
  108. endif
  109. "set autowrite " Automatically write a file when leaving a modified buffer
  110. set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter')
  111. set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
  112. set virtualedit=onemore " Allow for cursor beyond last character
  113. set history=1000 " Store a ton of history (default is 20)
  114. set spell " Spell checking on
  115. set hidden " Allow buffer switching without saving
  116. set iskeyword-=. " '.' is an end of word designator
  117. set iskeyword-=# " '#' is an end of word designator
  118. set iskeyword-=- " '-' is an end of word designator
  119. " Instead of reverting the cursor to the last position in the buffer, we
  120. " set it to the first line when editing a git commit message
  121. au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
  122. " http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
  123. " Restore cursor to file position in previous editing session
  124. " To disable this, add the following to your .vimrc.before.local file:
  125. " let g:spf13_no_restore_cursor = 1
  126. if !exists('g:spf13_no_restore_cursor')
  127. function! ResCur()
  128. if line("'\"") <= line("$")
  129. silent! normal! g`"
  130. return 1
  131. endif
  132. endfunction
  133. augroup resCur
  134. autocmd!
  135. autocmd BufWinEnter * call ResCur()
  136. augroup END
  137. endif
  138. " Setting up the directories {
  139. set backup " Backups are nice ...
  140. if has('persistent_undo')
  141. set undofile " So is persistent undo ...
  142. set undolevels=1000 " Maximum number of changes that can be undone
  143. set undoreload=10000 " Maximum number lines to save for undo on a buffer reload
  144. endif
  145. " To disable views add the following to your .vimrc.before.local file:
  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
  154. " }
  155. " }
  156. " Vim UI {
  157. if !exists('g:override_spf13_bundles') && filereadable(expand("~/.vim/bundle/vim-colors-solarized/colors/solarized.vim"))
  158. let g:solarized_termcolors=256
  159. let g:solarized_termtrans=1
  160. let g:solarized_contrast="normal"
  161. let g:solarized_visibility="normal"
  162. color solarized " Load a colorscheme
  163. endif
  164. set tabpagemax=15 " Only show 15 tabs
  165. set showmode " Display the current mode
  166. set cursorline " Highlight current line
  167. highlight clear SignColumn " SignColumn should match background
  168. highlight clear LineNr " Current line number row will have same background color in relative mode
  169. "highlight clear CursorLineNr " Remove highlight color from current line number
  170. if has('cmdline_info')
  171. set ruler " Show the ruler
  172. set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids
  173. set showcmd " Show partial commands in status line and
  174. " Selected characters/lines in visual mode
  175. endif
  176. if has('statusline')
  177. set laststatus=2
  178. " Broken down into easily includeable segments
  179. set statusline=%<%f\ " Filename
  180. set statusline+=%w%h%m%r " Options
  181. if !exists('g:override_spf13_bundles')
  182. set statusline+=%{fugitive#statusline()} " Git Hotness
  183. endif
  184. set statusline+=\ [%{&ff}/%Y] " Filetype
  185. set statusline+=\ [%{getcwd()}] " Current dir
  186. set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
  187. endif
  188. set backspace=indent,eol,start " Backspace for dummies
  189. set linespace=0 " No extra spaces between rows
  190. set number " Line numbers on
  191. set showmatch " Show matching brackets/parenthesis
  192. set incsearch " Find as you type search
  193. set hlsearch " Highlight search terms
  194. set winminheight=0 " Windows can be 0 line high
  195. set ignorecase " Case insensitive search
  196. set smartcase " Case sensitive when uc present
  197. set wildmenu " Show list instead of just completing
  198. set wildmode=list:longest,full " Command completion, list matches, then longest common part, then all.
  199. set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
  200. set scrolljump=5 " Lines to scroll when cursor leaves screen
  201. set scrolloff=3 " Minimum lines to keep above and below cursor
  202. set foldenable " Auto fold code
  203. set list
  204. set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
  205. " }
  206. " Formatting {
  207. set nowrap " Do not wrap long lines
  208. set autoindent " Indent at the same level of the previous line
  209. set shiftwidth=4 " Use indents of 4 spaces
  210. set expandtab " Tabs are spaces, not tabs
  211. set tabstop=4 " An indentation every four columns
  212. set softtabstop=4 " Let backspace delete indent
  213. set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
  214. set splitright " Puts new vsplit windows to the right of the current
  215. set splitbelow " Puts new split windows to the bottom of the current
  216. "set matchpairs+=<:> " Match, to be used with %
  217. set pastetoggle= " pastetoggle (sane indentation on pastes)
  218. "set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
  219. " Remove trailing whitespaces and ^M chars
  220. " To disable the stripping of whitespace, add the following to your
  221. " .vimrc.before.local file:
  222. " let g:spf13_keep_trailing_whitespace = 1
  223. autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif
  224. "autocmd FileType go autocmd BufWritePre Fmt
  225. autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
  226. autocmd FileType haskell,puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2
  227. " preceding line best in a plugin but here for now.
  228. autocmd BufNewFile,BufRead *.coffee set filetype=coffee
  229. " Workaround vim-commentary for Haskell
  230. autocmd FileType haskell setlocal commentstring=--\ %s
  231. " Workaround broken colour highlighting in Haskell
  232. autocmd FileType haskell,rust setlocal nospell
  233. " }
  234. " Key (re)Mappings {
  235. " The default leader is '\', but many people prefer ',' as it's in a standard
  236. " location. To override this behavior and set it back to '\' (or any other
  237. " character) add the following to your .vimrc.before.local file:
  238. " let g:spf13_leader='\'
  239. if !exists('g:spf13_leader')
  240. let mapleader = ','
  241. else
  242. let mapleader=g:spf13_leader
  243. endif
  244. if !exists('g:spf13_localleader')
  245. let maplocalleader = '_'
  246. else
  247. let maplocalleader=g:spf13_localleader
  248. endif
  249. " The default mappings for editing and applying the spf13 configuration
  250. " are ev and sv respectively. Change them to your preference
  251. " by adding the following to your .vimrc.before.local file:
  252. " let g:spf13_edit_config_mapping='ec'
  253. " let g:spf13_apply_config_mapping='sc'
  254. if !exists('g:spf13_edit_config_mapping')
  255. let s:spf13_edit_config_mapping = 'ev'
  256. else
  257. let s:spf13_edit_config_mapping = g:spf13_edit_config_mapping
  258. endif
  259. if !exists('g:spf13_apply_config_mapping')
  260. let s:spf13_apply_config_mapping = 'sv'
  261. else
  262. let s:spf13_apply_config_mapping = g:spf13_apply_config_mapping
  263. endif
  264. " Easier moving in tabs and windows
  265. " The lines conflict with the default digraph mapping of
  266. " If you prefer that functionality, add the following to your
  267. " .vimrc.before.local file:
  268. " let g:spf13_no_easyWindows = 1
  269. if !exists('g:spf13_no_easyWindows')
  270. map j_
  271. map k_
  272. map l_
  273. map h_
  274. endif
  275. " Wrapped lines goes down/up to next row, rather than next line in file.
  276. noremap j gj
  277. noremap k gk
  278. " End/Start of line motion keys act relative to row/wrap width in the
  279. " presence of `:set wrap`, and relative to line for `:set nowrap`.
  280. " Default vim behaviour is to act relative to text line in both cases
  281. " If you prefer the default behaviour, add the following to your
  282. " .vimrc.before.local file:
  283. " let g:spf13_no_wrapRelMotion = 1
  284. if !exists('g:spf13_no_wrapRelMotion')
  285. " Same for 0, home, end, etc
  286. function! WrapRelativeMotion(key, ...)
  287. let vis_sel=""
  288. if a:0
  289. let vis_sel="gv"
  290. endif
  291. if &wrap
  292. execute "normal!" vis_sel . "g" . a:key
  293. else
  294. execute "normal!" vis_sel . a:key
  295. endif
  296. endfunction
  297. " Map g* keys in Normal, Operator-pending, and Visual+select
  298. noremap $ :call WrapRelativeMotion("$")
  299. noremap :call WrapRelativeMotion("$")
  300. noremap 0 :call WrapRelativeMotion("0")
  301. noremap :call WrapRelativeMotion("0")
  302. noremap ^ :call WrapRelativeMotion("^")
  303. " Overwrite the operator pending $/ mappings from above
  304. " to force inclusive motion with :execute normal!
  305. onoremap $ v:call WrapRelativeMotion("$")
  306. onoremap v:call WrapRelativeMotion("$")
  307. " Overwrite the Visual+select mode mappings from above
  308. " to ensure the correct vis_sel flag is passed to function
  309. vnoremap $ :call WrapRelativeMotion("$", 1)
  310. vnoremap :call WrapRelativeMotion("$", 1)
  311. vnoremap 0 :call WrapRelativeMotion("0", 1)
  312. vnoremap :call WrapRelativeMotion("0", 1)
  313. vnoremap ^ :call WrapRelativeMotion("^", 1)
  314. endif
  315. " The following two lines conflict with moving to top and
  316. " bottom of the screen
  317. " If you prefer that functionality, add the following to your
  318. " .vimrc.before.local file:
  319. " let g:spf13_no_fastTabs = 1
  320. if !exists('g:spf13_no_fastTabs')
  321. map gT
  322. map gt
  323. endif
  324. " Stupid shift key fixes
  325. if !exists('g:spf13_no_keyfixes')
  326. if has("user_commands")
  327. command! -bang -nargs=* -complete=file E e
  328. command! -bang -nargs=* -complete=file W w
  329. command! -bang -nargs=* -complete=file Wq wq
  330. command! -bang -nargs=* -complete=file WQ wq
  331. command! -bang Wa wa
  332. command! -bang WA wa
  333. command! -bang Q q
  334. command! -bang QA qa
  335. command! -bang Qa qa
  336. endif
  337. cmap Tabe tabe
  338. endif
  339. " Yank from the cursor to the end of the line, to be consistent with C and D.
  340. nnoremap Y y$
  341. " Code folding options
  342. nmap f0 :set foldlevel=0
  343. nmap f1 :set foldlevel=1
  344. nmap f2 :set foldlevel=2
  345. nmap f3 :set foldlevel=3
  346. nmap f4 :set foldlevel=4
  347. nmap f5 :set foldlevel=5
  348. nmap f6 :set foldlevel=6
  349. nmap f7 :set foldlevel=7
  350. nmap f8 :set foldlevel=8
  351. nmap f9 :set foldlevel=9
  352. " Most prefer to toggle search highlighting rather than clear the current
  353. " search results. To clear search highlighting rather than toggle it on
  354. " and off, add the following to your .vimrc.before.local file:
  355. " let g:spf13_clear_search_highlight = 1
  356. if exists('g:spf13_clear_search_highlight')
  357. nmap / :nohlsearch
  358. else
  359. nmap / :set invhlsearch
  360. endif
  361. " Find merge conflict markers
  362. map fc /\v^[<\|=>]{7}( .*\|$)
  363. " Shortcuts
  364. " Change Working Directory to that of the current file
  365. cmap cwd lcd %:p:h
  366. cmap cd. lcd %:p:h
  367. " Visual shifting (does not exit Visual mode)
  368. vnoremap < >gv
  369. " Allow using the repeat operator with a visual selection (!)
  370. " http://stackoverflow.com/a/8064607/127816
  371. vnoremap . :normal .
  372. " For when you forget to sudo.. Really Write the file.
  373. cmap w!! w !sudo tee % >/dev/null
  374. " Some helpers to edit mode
  375. " http://vimcasts.org/e/14
  376. cnoremap %% =fnameescape(expand('%:h')).'/'
  377. map ew :e %%
  378. map es :sp %%
  379. map ev :vsp %%
  380. map et :tabe %%
  381. " Adjust viewports to the same size
  382. map = =
  383. " Map ff to display all lines with keyword under cursor
  384. " and ask which one to jump to
  385. nmap ff [I:let nr = input("Which one: ")exe "normal " . nr ."[\t"
  386. " Easier horizontal scrolling
  387. map zl zL
  388. map zh zH
  389. " Easier formatting
  390. nnoremap q gwip
  391. " FIXME: Revert this f70be548
  392. " fullscreen mode for GVIM and Terminal, need 'wmctrl' in you PATH
  393. map :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")
  394. " }
  395. " Plugins {
  396. " GoLang {
  397. if count(g:spf13_bundle_groups, 'go')
  398. let g:go_highlight_functions = 1
  399. let g:go_highlight_methods = 1
  400. let g:go_highlight_structs = 1
  401. let g:go_highlight_operators = 1
  402. let g:go_highlight_build_constraints = 1
  403. let g:go_fmt_command = "goimports"
  404. let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
  405. let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
  406. au FileType go nmap s (go-implements)
  407. au FileType go nmap i (go-info)
  408. au FileType go nmap e (go-rename)
  409. au FileType go nmap r (go-run)
  410. au FileType go nmap b (go-build)
  411. au FileType go nmap t (go-test)
  412. au FileType go nmap gd (go-doc)
  413. au FileType go nmap gv (go-doc-vertical)
  414. au FileType go nmap co (go-coverage)
  415. endif
  416. " }
  417. " TextObj Sentence {
  418. if count(g:spf13_bundle_groups, 'writing')
  419. augroup textobj_sentence
  420. autocmd!
  421. autocmd FileType markdown call textobj#sentence#init()
  422. autocmd FileType textile call textobj#sentence#init()
  423. autocmd FileType text call textobj#sentence#init()
  424. augroup END
  425. endif
  426. " }
  427. " TextObj Quote {
  428. if count(g:spf13_bundle_groups, 'writing')
  429. augroup textobj_quote
  430. autocmd!
  431. autocmd FileType markdown call textobj#quote#init()
  432. autocmd FileType textile call textobj#quote#init()
  433. autocmd FileType text call textobj#quote#init({'educate': 0})
  434. augroup END
  435. endif
  436. " }
  437. " PIV {
  438. if isdirectory(expand("~/.vim/bundle/PIV"))
  439. let g:DisableAutoPHPFolding = 0
  440. let g:PIVAutoClose = 0
  441. endif
  442. " }
  443. " Misc {
  444. if isdirectory(expand("~/.vim/bundle/nerdtree"))
  445. let g:NERDShutUp=1
  446. endif
  447. if isdirectory(expand("~/.vim/bundle/matchit.zip"))
  448. let b:match_ignorecase = 1
  449. endif
  450. " }
  451. " OmniComplete {
  452. " To disable omni complete, add the following to your .vimrc.before.local file:
  453. " let g:spf13_no_omni_complete = 1
  454. if !exists('g:spf13_no_omni_complete')
  455. if has("autocmd") && exists("+omnifunc")
  456. autocmd Filetype *
  457. \if &omnifunc == "" |
  458. \setlocal omnifunc=syntaxcomplete#Complete |
  459. \endif
  460. endif
  461. hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
  462. hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
  463. hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
  464. " Some convenient mappings
  465. "inoremap pumvisible() ? "\" : "\"
  466. if exists('g:spf13_map_cr_omni_complete')
  467. inoremap pumvisible() ? "\" : "\"
  468. endif
  469. inoremap pumvisible() ? "\" : "\"
  470. inoremap pumvisible() ? "\" : "\"
  471. inoremap pumvisible() ? "\\\" : "\"
  472. inoremap pumvisible() ? "\\\" : "\"
  473. " Automatically open and close the popup menu / preview window
  474. au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
  475. set completeopt=menu,preview,longest
  476. endif
  477. " }
  478. " Ctags {
  479. set tags=./tags;/,~/.vimtags
  480. " Make tags placed in .git/tags file available in all levels of a repository
  481. let gitroot = substitute(system('git rev-parse --show-toplevel'), '[\n\r]', '', 'g')
  482. if gitroot != ''
  483. let &tags = &tags . ',' . gitroot . '/.git/tags'
  484. endif
  485. " }
  486. " AutoCloseTag {
  487. " Make it so AutoCloseTag works for xml and xhtml files as well
  488. au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
  489. nmap ac ToggleAutoCloseMappings
  490. " }
  491. " SnipMate {
  492. " Setting the author var
  493. " If forking, please overwrite in your .vimrc.local file
  494. let g:snips_author = 'Steve Francia '
  495. " }
  496. " NerdTree {
  497. if isdirectory(expand("~/.vim/bundle/nerdtree"))
  498. map NERDTreeTabsToggle
  499. map e :NERDTreeFind
  500. nmap nt :NERDTreeFind
  501. let NERDTreeShowBookmarks=1
  502. let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
  503. let NERDTreeChDirMode=0
  504. let NERDTreeQuitOnOpen=1
  505. let NERDTreeMouseMode=2
  506. let NERDTreeShowHidden=1
  507. let NERDTreeKeepTreeInNewTab=1
  508. let g:nerdtree_tabs_open_on_gui_startup=0
  509. endif
  510. " }
  511. " Tabularize {
  512. if isdirectory(expand("~/.vim/bundle/tabular"))
  513. nmap a& :Tabularize /&
  514. vmap a& :Tabularize /&
  515. nmap a= :Tabularize /^[^=]*\zs=
  516. vmap a= :Tabularize /^[^=]*\zs=
  517. nmap a=> :Tabularize /=>
  518. vmap a=> :Tabularize /=>
  519. nmap a: :Tabularize /:
  520. vmap a: :Tabularize /:
  521. nmap a:: :Tabularize /:\zs
  522. vmap a:: :Tabularize /:\zs
  523. nmap a, :Tabularize /,
  524. vmap a, :Tabularize /,
  525. nmap a,, :Tabularize /,\zs
  526. vmap a,, :Tabularize /,\zs
  527. nmap a :Tabularize /
  528. vmap a :Tabularize /
  529. endif
  530. " }
  531. " Session List {
  532. set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize
  533. if isdirectory(expand("~/.vim/bundle/sessionman.vim/"))
  534. nmap sl :SessionList
  535. nmap ss :SessionSave
  536. nmap sc :SessionClose
  537. endif
  538. " }
  539. " JSON {
  540. nmap jt :%!python -m json.tool:set filetype=json
  541. let g:vim_json_syntax_conceal = 0
  542. " }
  543. " PyMode {
  544. " Disable if python support not present
  545. if !has('python') && !has('python3')
  546. let g:pymode = 0
  547. endif
  548. if isdirectory(expand("~/.vim/bundle/python-mode"))
  549. let g:pymode_lint_checkers = ['pyflakes']
  550. let g:pymode_trim_whitespaces = 0
  551. let g:pymode_options = 0
  552. let g:pymode_rope = 0
  553. endif
  554. " }
  555. " ctrlp {
  556. if isdirectory(expand("~/.vim/bundle/ctrlp.vim/"))
  557. let g:ctrlp_working_path_mode = 'ra'
  558. nnoremap :CtrlP
  559. nnoremap :CtrlPMRU
  560. let g:ctrlp_custom_ignore = {
  561. \ 'dir': '\.git$\|\.hg$\|\.svn$',
  562. \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' }
  563. if executable('ag')
  564. let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""'
  565. elseif executable('ack-grep')
  566. let s:ctrlp_fallback = 'ack-grep %s --nocolor -f'
  567. elseif executable('ack')
  568. let s:ctrlp_fallback = 'ack %s --nocolor -f'
  569. " On Windows use "dir" as fallback command.
  570. elseif WINDOWS()
  571. let s:ctrlp_fallback = 'dir %s /-n /b /s /a-d'
  572. else
  573. let s:ctrlp_fallback = 'find %s -type f'
  574. endif
  575. if exists("g:ctrlp_user_command")
  576. unlet g:ctrlp_user_command
  577. endif
  578. let g:ctrlp_user_command = {
  579. \ 'types': {
  580. \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
  581. \ 2: ['.hg', 'hg --cwd %s locate -I .'],
  582. \ },
  583. \ 'fallback': s:ctrlp_fallback
  584. \ }
  585. if isdirectory(expand("~/.vim/bundle/ctrlp-funky/"))
  586. " CtrlP extensions
  587. let g:ctrlp_extensions = ['funky']
  588. "funky
  589. nnoremap fu :CtrlPFunky
  590. endif
  591. endif
  592. "}
  593. " TagBar {
  594. if isdirectory(expand("~/.vim/bundle/tagbar/"))
  595. nnoremap tt :TagbarToggle
  596. endif
  597. "}
  598. " Rainbow {
  599. if isdirectory(expand("~/.vim/bundle/rainbow/"))
  600. let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle
  601. endif
  602. "}
  603. " Fugitive {
  604. if isdirectory(expand("~/.vim/bundle/vim-fugitive/"))
  605. nnoremap gs :Gstatus
  606. nnoremap gd :Gdiff
  607. nnoremap gc :Gcommit
  608. nnoremap gb :Gblame
  609. nnoremap gl :Glog
  610. nnoremap gp :Git push
  611. nnoremap gr :Gread
  612. nnoremap gw :Gwrite
  613. nnoremap ge :Gedit
  614. " Mnemonic _i_nteractive
  615. nnoremap gi :Git add -p %
  616. nnoremap gg :SignifyToggle
  617. endif
  618. "}
  619. " YouCompleteMe {
  620. if count(g:spf13_bundle_groups, 'youcompleteme')
  621. let g:acp_enableAtStartup = 0
  622. " enable completion from tags
  623. let g:ycm_collect_identifiers_from_tags_files = 1
  624. " remap Ultisnips for compatibility for YCM
  625. let g:UltiSnipsExpandTrigger = ''
  626. let g:UltiSnipsJumpForwardTrigger = ''
  627. let g:UltiSnipsJumpBackwardTrigger = ''
  628. " Enable omni completion.
  629. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  630. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  631. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  632. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  633. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  634. autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
  635. autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
  636. " Haskell post write lint and check with ghcmod
  637. " $ `cabal install ghcmod` if missing and ensure
  638. " ~/.cabal/bin is in your $PATH.
  639. if !executable("ghcmod")
  640. autocmd BufWritePost *.hs GhcModCheckAndLintAsync
  641. endif
  642. " For snippet_complete marker.
  643. if !exists("g:spf13_no_conceal")
  644. if has('conceal')
  645. set conceallevel=2 concealcursor=i
  646. endif
  647. endif
  648. " Disable the neosnippet preview candidate window
  649. " When enabled, there can be too much visual noise
  650. " especially when splits are used.
  651. set completeopt-=preview
  652. endif
  653. " }
  654. " neocomplete {
  655. if count(g:spf13_bundle_groups, 'neocomplete')
  656. let g:acp_enableAtStartup = 0
  657. let g:neocomplete#enable_at_startup = 1
  658. let g:neocomplete#enable_smart_case = 1
  659. let g:neocomplete#enable_auto_delimiter = 1
  660. let g:neocomplete#max_list = 15
  661. let g:neocomplete#force_overwrite_completefunc = 1
  662. " Define dictionary.
  663. let g:neocomplete#sources#dictionary#dictionaries = {
  664. \ 'default' : '',
  665. \ 'vimshell' : $HOME.'/.vimshell_hist',
  666. \ 'scheme' : $HOME.'/.gosh_completions'
  667. \ }
  668. " Define keyword.
  669. if !exists('g:neocomplete#keyword_patterns')
  670. let g:neocomplete#keyword_patterns = {}
  671. endif
  672. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  673. " Plugin key-mappings {
  674. " These two lines conflict with the default digraph mapping of
  675. if !exists('g:spf13_no_neosnippet_expand')
  676. imap (neosnippet_expand_or_jump)
  677. smap (neosnippet_expand_or_jump)
  678. endif
  679. if exists('g:spf13_noninvasive_completion')
  680. inoremap
  681. " takes you out of insert mode
  682. inoremap pumvisible() ? "\\" : "\"
  683. " accepts first, then sends the
  684. inoremap pumvisible() ? "\\" : "\"
  685. " and cycle like and
  686. inoremap pumvisible() ? "\" : "\"
  687. inoremap pumvisible() ? "\" : "\"
  688. " Jump up and down the list
  689. inoremap pumvisible() ? "\\\" : "\"
  690. inoremap pumvisible() ? "\\\" : "\"
  691. else
  692. " Complete Snippet
  693. " Jump to next snippet point
  694. imap neosnippet#expandable() ?
  695. \ "\(neosnippet_expand_or_jump)" : (pumvisible() ?
  696. \ "\" : "\(neosnippet_expand_or_jump)")
  697. smap (neosnippet_jump_or_expand)
  698. inoremap neocomplete#undo_completion()
  699. inoremap neocomplete#complete_common_string()
  700. "inoremap neocomplete#complete_common_string()
  701. " : close popup
  702. " : close popup and save indent.
  703. inoremap pumvisible() ? neocomplete#smart_close_popup()."\" : "\"
  704. function! CleverCr()
  705. if pumvisible()
  706. if neosnippet#expandable()
  707. let exp = "\(neosnippet_expand)"
  708. return exp . neocomplete#smart_close_popup()
  709. else
  710. return neocomplete#smart_close_popup()
  711. endif
  712. else
  713. return "\"
  714. endif
  715. endfunction
  716. " close popup and save indent or expand snippet
  717. imap CleverCr()
  718. " , : close popup and delete backword char.
  719. inoremap neocomplete#smart_close_popup()."\"
  720. inoremap neocomplete#smart_close_popup()
  721. endif
  722. " : completion.
  723. inoremap pumvisible() ? "\" : "\"
  724. inoremap pumvisible() ? "\" : "\"
  725. " Courtesy of Matteo Cavalleri
  726. function! CleverTab()
  727. if pumvisible()
  728. return "\"
  729. endif
  730. let substr = strpart(getline('.'), 0, col('.') - 1)
  731. let substr = matchstr(substr, '[^ \t]*$')
  732. if strlen(substr) == 0
  733. " nothing to match on empty string
  734. return "\"
  735. else
  736. " existing text matching
  737. if neosnippet#expandable_or_jumpable()
  738. return "\(neosnippet_expand_or_jump)"
  739. else
  740. return neocomplete#start_manual_complete()
  741. endif
  742. endif
  743. endfunction
  744. imap CleverTab()
  745. " }
  746. " Enable heavy omni completion.
  747. if !exists('g:neocomplete#sources#omni#input_patterns')
  748. let g:neocomplete#sources#omni#input_patterns = {}
  749. endif
  750. let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  751. let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
  752. let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  753. let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  754. let g:neocomplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
  755. " }
  756. " neocomplcache {
  757. elseif count(g:spf13_bundle_groups, 'neocomplcache')
  758. let g:acp_enableAtStartup = 0
  759. let g:neocomplcache_enable_at_startup = 1
  760. let g:neocomplcache_enable_camel_case_completion = 1
  761. let g:neocomplcache_enable_smart_case = 1
  762. let g:neocomplcache_enable_underbar_completion = 1
  763. let g:neocomplcache_enable_auto_delimiter = 1
  764. let g:neocomplcache_max_list = 15
  765. let g:neocomplcache_force_overwrite_completefunc = 1
  766. " Define dictionary.
  767. let g:neocomplcache_dictionary_filetype_lists = {
  768. \ 'default' : '',
  769. \ 'vimshell' : $HOME.'/.vimshell_hist',
  770. \ 'scheme' : $HOME.'/.gosh_completions'
  771. \ }
  772. " Define keyword.
  773. if !exists('g:neocomplcache_keyword_patterns')
  774. let g:neocomplcache_keyword_patterns = {}
  775. endif
  776. let g:neocomplcache_keyword_patterns._ = '\h\w*'
  777. " Plugin key-mappings {
  778. " These two lines conflict with the default digraph mapping of
  779. imap (neosnippet_expand_or_jump)
  780. smap (neosnippet_expand_or_jump)
  781. if exists('g:spf13_noninvasive_completion')
  782. inoremap
  783. " takes you out of insert mode
  784. inoremap pumvisible() ? "\\" : "\"
  785. " accepts first, then sends the
  786. inoremap pumvisible() ? "\\" : "\"
  787. " and cycle like and
  788. inoremap pumvisible() ? "\" : "\"
  789. inoremap pumvisible() ? "\" : "\"
  790. " Jump up and down the list
  791. inoremap pumvisible() ? "\\\" : "\"
  792. inoremap pumvisible() ? "\\\" : "\"
  793. else
  794. imap neosnippet#expandable() ?
  795. \ "\(neosnippet_expand_or_jump)" : (pumvisible() ?
  796. \ "\" : "\(neosnippet_expand_or_jump)")
  797. smap (neosnippet_jump_or_expand)
  798. inoremap neocomplcache#undo_completion()
  799. inoremap neocomplcache#complete_common_string()
  800. "inoremap neocomplcache#complete_common_string()
  801. function! CleverCr()
  802. if pumvisible()
  803. if neosnippet#expandable()
  804. let exp = "\(neosnippet_expand)"
  805. return exp . neocomplcache#close_popup()
  806. else
  807. return neocomplcache#close_popup()
  808. endif
  809. else
  810. return "\"
  811. endif
  812. endfunction
  813. " close popup and save indent or expand snippet
  814. imap CleverCr()
  815. " : close popup
  816. " : close popup and save indent.
  817. inoremap pumvisible() ? neocomplcache#close_popup()."\" : "\"
  818. "inoremap pumvisible() ? neocomplcache#close_popup() : "\"
  819. " , : close popup and delete backword char.
  820. inoremap neocomplcache#smart_close_popup()."\"
  821. inoremap neocomplcache#close_popup()
  822. endif
  823. " : completion.
  824. inoremap pumvisible() ? "\" : "\"
  825. inoremap pumvisible() ? "\" : "\"
  826. " }
  827. " Enable omni completion.
  828. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  829. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  830. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  831. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  832. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  833. autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
  834. autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
  835. " Enable heavy omni completion.
  836. if !exists('g:neocomplcache_omni_patterns')
  837. let g:neocomplcache_omni_patterns = {}
  838. endif
  839. let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  840. let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
  841. let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  842. let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  843. let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
  844. let g:neocomplcache_omni_patterns.go = '\h\w*\.\?'
  845. " }
  846. " Normal Vim omni-completion {
  847. " To disable omni complete, add the following to your .vimrc.before.local file:
  848. " let g:spf13_no_omni_complete = 1
  849. elseif !exists('g:spf13_no_omni_complete')
  850. " Enable omni-completion.
  851. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  852. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  853. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  854. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  855. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  856. autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
  857. autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
  858. endif
  859. " }
  860. " Snippets {
  861. if count(g:spf13_bundle_groups, 'neocomplcache') ||
  862. \ count(g:spf13_bundle_groups, 'neocomplete')
  863. " Use honza's snippets.
  864. let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
  865. " Enable neosnippet snipmate compatibility mode
  866. let g:neosnippet#enable_snipmate_compatibility = 1
  867. " For snippet_complete marker.
  868. if !exists("g:spf13_no_conceal")
  869. if has('conceal')
  870. set conceallevel=2 concealcursor=i
  871. endif
  872. endif
  873. " Enable neosnippets when using go
  874. let g:go_snippet_engine = "neosnippet"
  875. " Disable the neosnippet preview candidate window
  876. " When enabled, there can be too much visual noise
  877. " especially when splits are used.
  878. set completeopt-=preview
  879. endif
  880. " }
  881. " FIXME: Isn't this for Syntastic to handle?
  882. " Haskell post write lint and check with ghcmod
  883. " $ `cabal install ghcmod` if missing and ensure
  884. " ~/.cabal/bin is in your $PATH.
  885. if !executable("ghcmod")
  886. autocmd BufWritePost *.hs GhcModCheckAndLintAsync
  887. endif
  888. " UndoTree {
  889. if isdirectory(expand("~/.vim/bundle/undotree/"))
  890. nnoremap u :UndotreeToggle
  891. " If undotree is opened, it is likely one wants to interact with it.
  892. let g:undotree_SetFocusWhenToggle=1
  893. endif
  894. " }
  895. " indent_guides {
  896. if isdirectory(expand("~/.vim/bundle/vim-indent-guides/"))
  897. let g:indent_guides_start_level = 2
  898. let g:indent_guides_guide_size = 1
  899. let g:indent_guides_enable_on_vim_startup = 1
  900. endif
  901. " }
  902. " Wildfire {
  903. let g:wildfire_objects = {
  904. \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"],
  905. \ "html,xml" : ["at"],
  906. \ }
  907. " }
  908. " vim-airline {
  909. " Set configuration options for the statusline plugin vim-airline.
  910. " Use the powerline theme and optionally enable powerline symbols.
  911. " To use the symbols , , , , , , and .in the statusline
  912. " segments add the following to your .vimrc.before.local file:
  913. " let g:airline_powerline_fonts=1
  914. " If the previous symbols do not render for you then install a
  915. " powerline enabled font.
  916. " See `:echo g:airline_theme_map` for some more choices
  917. " Default in terminal vim is 'dark'
  918. if isdirectory(expand("~/.vim/bundle/vim-airline-themes/"))
  919. if !exists('g:airline_theme')
  920. let g:airline_theme = 'solarized'
  921. endif
  922. if !exists('g:airline_powerline_fonts')
  923. " Use the default set of separators with a few customizations
  924. let g:airline_left_sep='›' " Slightly fancier than '>'
  925. let g:airline_right_sep='‹' " Slightly fancier than '<'
  926. endif
  927. endif
  928. " }
  929. " }
  930. " GUI Settings {
  931. " GVIM- (here instead of .gvimrc)
  932. if has('gui_running')
  933. set guioptions-=T " Remove the toolbar
  934. set lines=40 " 40 lines of text instead of 24
  935. if !exists("g:spf13_no_big_font")
  936. if LINUX() && has("gui_running")
  937. set guifont=Andale\ Mono\ Regular\ 12,Menlo\ Regular\ 11,Consolas\ Regular\ 12,Courier\ New\ Regular\ 14
  938. elseif OSX() && has("gui_running")
  939. set guifont=Andale\ Mono\ Regular:h12,Menlo\ Regular:h11,Consolas\ Regular:h12,Courier\ New\ Regular:h14
  940. elseif WINDOWS() && has("gui_running")
  941. set guifont=Andale_Mono:h10,Menlo:h10,Consolas:h10,Courier_New:h10
  942. endif
  943. endif
  944. else
  945. if &term == 'xterm' || &term == 'screen'
  946. set t_Co=256 " Enable 256 colors to stop the CSApprox warning and make xterm vim shine
  947. endif
  948. "set term=builtin_ansi " Make arrow and other keys work
  949. endif
  950. " }
  951. " Functions {
  952. " Initialize directories {
  953. function! InitializeDirectories()
  954. let parent = $HOME
  955. let prefix = 'vim'
  956. let dir_list = {
  957. \ 'backup': 'backupdir',
  958. \ 'views': 'viewdir',
  959. \ 'swap': 'directory' }
  960. if has('persistent_undo')
  961. let dir_list['undo'] = 'undodir'
  962. endif
  963. " To specify a different directory in which to place the vimbackup,
  964. " vimviews, vimundo, and vimswap files/directories, add the following to
  965. " your .vimrc.before.local file:
  966. " let g:spf13_consolidated_directory =
  967. " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/'
  968. if exists('g:spf13_consolidated_directory')
  969. let common_dir = g:spf13_consolidated_directory . prefix
  970. else
  971. let common_dir = parent . '/.' . prefix
  972. endif
  973. for [dirname, settingname] in items(dir_list)
  974. let directory = common_dir . dirname . '/'
  975. if exists("*mkdir")
  976. if !isdirectory(directory)
  977. call mkdir(directory)
  978. endif
  979. endif
  980. if !isdirectory(directory)
  981. echo "Warning: Unable to create backup directory: " . directory
  982. echo "Try: mkdir -p " . directory
  983. else
  984. let directory = substitute(directory, " ", "\\\\ ", "g")
  985. exec "set " . settingname . "=" . directory
  986. endif
  987. endfor
  988. endfunction
  989. call InitializeDirectories()
  990. " }
  991. " Initialize NERDTree as needed {
  992. function! NERDTreeInitAsNeeded()
  993. redir => bufoutput
  994. buffers!
  995. redir END
  996. let idx = stridx(bufoutput, "NERD_tree")
  997. if idx > -1
  998. NERDTreeMirror
  999. NERDTreeFind
  1000. wincmd l
  1001. endif
  1002. endfunction
  1003. " }
  1004. " Strip whitespace {
  1005. function! StripTrailingWhitespace()
  1006. " Preparation: save last search, and cursor position.
  1007. let _s=@/
  1008. let l = line(".")
  1009. let c = col(".")
  1010. " do the business:
  1011. %s/\s\+$//e
  1012. " clean up: restore previous search history, and cursor position
  1013. let @/=_s
  1014. call cursor(l, c)
  1015. endfunction
  1016. " }
  1017. " Shell command {
  1018. function! s:RunShellCommand(cmdline)
  1019. botright new
  1020. setlocal buftype=nofile
  1021. setlocal bufhidden=delete
  1022. setlocal nobuflisted
  1023. setlocal noswapfile
  1024. setlocal nowrap
  1025. setlocal filetype=shell
  1026. setlocal syntax=shell
  1027. call setline(1, a:cmdline)
  1028. call setline(2, substitute(a:cmdline, '.', '=', 'g'))
  1029. execute 'silent $read !' . escape(a:cmdline, '%#')
  1030. setlocal nomodifiable
  1031. 1
  1032. endfunction
  1033. command! -complete=file -nargs=+ Shell call s:RunShellCommand()
  1034. " e.g. Grep current file for : Shell grep -Hn %
  1035. " }
  1036. function! s:IsSpf13Fork()
  1037. let s:is_fork = 0
  1038. let s:fork_files = ["~/.vimrc.fork", "~/.vimrc.before.fork", "~/.vimrc.bundles.fork"]
  1039. for fork_file in s:fork_files
  1040. if filereadable(expand(fork_file, ":p"))
  1041. let s:is_fork = 1
  1042. break
  1043. endif
  1044. endfor
  1045. return s:is_fork
  1046. endfunction
  1047. function! s:ExpandFilenameAndExecute(command, file)
  1048. execute a:command . " " . expand(a:file, ":p")
  1049. endfunction
  1050. function! s:EditSpf13Config()
  1051. call ExpandFilenameAndExecute("tabedit", "~/.vimrc")
  1052. call ExpandFilenameAndExecute("vsplit", "~/.vimrc.before")
  1053. call ExpandFilenameAndExecute("vsplit", "~/.vimrc.bundles")
  1054. execute bufwinnr(".vimrc") . "wincmd w"
  1055. call ExpandFilenameAndExecute("split", "~/.vimrc.local")
  1056. wincmd l
  1057. call ExpandFilenameAndExecute("split", "~/.vimrc.before.local")
  1058. wincmd l
  1059. call ExpandFilenameAndExecute("split", "~/.vimrc.bundles.local")
  1060. if IsSpf13Fork()
  1061. execute bufwinnr(".vimrc") . "wincmd w"
  1062. call ExpandFilenameAndExecute("split", "~/.vimrc.fork")
  1063. wincmd l
  1064. call ExpandFilenameAndExecute("split", "~/.vimrc.before.fork")
  1065. wincmd l
  1066. call ExpandFilenameAndExecute("split", "~/.vimrc.bundles.fork")
  1067. endif
  1068. execute bufwinnr(".vimrc.local") . "wincmd w"
  1069. endfunction
  1070. execute "noremap " . s:spf13_edit_config_mapping " :call EditSpf13Config()"
  1071. execute "noremap " . s:spf13_apply_config_mapping . " :source ~/.vimrc"
  1072. " }
  1073. " Use fork vimrc if available {
  1074. if filereadable(expand("~/.vimrc.fork"))
  1075. source ~/.vimrc.fork
  1076. endif
  1077. " }
  1078. " Use local vimrc if available {
  1079. if filereadable(expand("~/.vimrc.local"))
  1080. source ~/.vimrc.local
  1081. endif
  1082. " }
  1083. " Use local gvimrc if available and gui is running {
  1084. if has('gui_running')
  1085. if filereadable(expand("~/.gvimrc.local"))
  1086. source ~/.gvimrc.local
  1087. endif
  1088. endif
  1089. " }

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了