mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-11-25 12:41:26 -05:00
Undo history and syntax errors can now be toggled with F9 and ctrl-F9.
Nerdtree was dropped in favour of the much better vimfiler. The status bar was reconfigured to display more information including the current number of errors. A script was added that can generate a tags file from /usr/include for more robust syntax checking in C. The update script was updated to hopefully handle the removal of nerdtree when it updates the submodules... Syntax highlighting has been improved in numerous directions including more definitions as well as tweaked colours. Keybindings were tweaked again and new ones added for the new features. The paste function was incorrectly using buffer 0 instead of the current buffer when in visual mode, but this is no longer the case. Autocompletion has been improved quite a bit and the keybindings tweaked. A bunch of general fixes and tidying up was done.
This commit is contained in:
parent
f67a01fca4
commit
d5d4189e78
13 changed files with 289 additions and 106 deletions
15
.gitmodules
vendored
15
.gitmodules
vendored
|
@ -34,9 +34,6 @@
|
||||||
[submodule "vim/bundle/emmet-vim"]
|
[submodule "vim/bundle/emmet-vim"]
|
||||||
path = vim/bundle/emmet-vim
|
path = vim/bundle/emmet-vim
|
||||||
url = https://github.com/mattn/emmet-vim.git
|
url = https://github.com/mattn/emmet-vim.git
|
||||||
[submodule "vim/bundle/nerdtree"]
|
|
||||||
path = vim/bundle/nerdtree
|
|
||||||
url = https://github.com/scrooloose/nerdtree.git
|
|
||||||
[submodule "vim/bundle/vim-markdown"]
|
[submodule "vim/bundle/vim-markdown"]
|
||||||
path = vim/bundle/vim-markdown
|
path = vim/bundle/vim-markdown
|
||||||
url = https://github.com/plasticboy/vim-markdown.git
|
url = https://github.com/plasticboy/vim-markdown.git
|
||||||
|
@ -46,3 +43,15 @@
|
||||||
[submodule "vim/bundle/vim-togglelist"]
|
[submodule "vim/bundle/vim-togglelist"]
|
||||||
path = vim/bundle/vim-togglelist
|
path = vim/bundle/vim-togglelist
|
||||||
url = https://github.com/milkypostman/vim-togglelist.git
|
url = https://github.com/milkypostman/vim-togglelist.git
|
||||||
|
[submodule "vim/bundle/gundo.vim"]
|
||||||
|
path = vim/bundle/gundo.vim
|
||||||
|
url = https://github.com/sjl/gundo.vim.git
|
||||||
|
[submodule "vim/bundle/unite.vim"]
|
||||||
|
path = vim/bundle/unite.vim
|
||||||
|
url = https://github.com/Shougo/unite.vim.git
|
||||||
|
[submodule "vim/bundle/vimfiler.vim"]
|
||||||
|
path = vim/bundle/vimfiler.vim
|
||||||
|
url = https://github.com/Shougo/vimfiler.vim.git
|
||||||
|
[submodule "vim/bundle/syntastic"]
|
||||||
|
path = vim/bundle/syntastic
|
||||||
|
url = https://github.com/scrooloose/syntastic.git
|
||||||
|
|
19
README.md
19
README.md
|
@ -3,10 +3,10 @@
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
1. Git: Required to clone and update the repository.
|
1. Git: Required to clone and update the repository.
|
||||||
3. CTags: Available @ http://ctags.sourceforge.net, this can be in $PATH or in the vim folder and is required for the tagbar plugin.
|
3. CTags: Available @ http://ctags.sourceforge.net, place in $PATH or the vim folder to use the tagbar or extended C omni/auto-completion.
|
||||||
4. Vim v7.4+: Everything has been written and tested using Vim 7.4.135, and I assume there could be issues with 7.3 and below.
|
4. Vim v7.4+: Everything has been written and tested using Vim 7.4.135, and I assume there could be issues with 7.3 and below.
|
||||||
2. Bash (optional): Required to use the update script, which simply runs the git repo and submodule update commands.
|
2. Bash (optional): Required to use the update and ctags generation scripts, both of which can be run with the commands listed within.
|
||||||
5. Powerline Fonts (optional): Required for the powerline lightline theme, which can be toggled in /etc/vimrc along with the gvim font
|
5. Powerline Fonts (optional): Required for an extended look/feel using lightline, otherwise it should be toggled off in the vimrc.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -14,15 +14,16 @@
|
||||||
* ]$ git clone https://github.com/prurigro/darkcloud-vimconfig.git
|
* ]$ git clone https://github.com/prurigro/darkcloud-vimconfig.git
|
||||||
* ]$ cd darkcloud-vimconfig
|
* ]$ cd darkcloud-vimconfig
|
||||||
* ]$ git submodule update --init
|
* ]$ git submodule update --init
|
||||||
2. Edit the 'vimrc' file and select whether to expect powerline fonts, choose a font for gvim, and add or change any of the loaded config files to match your personal setup.
|
2. Edit the 'vimrc' file and select whether to use powerline fonts, choose a font for gvim and add additional config after it loads the included files.
|
||||||
3. There are two main ways this package can be deployed: system-wide or single-user.
|
3. There are two main ways this package can be deployed: system-wide or single-user (vim must be configured to load from the respective location):
|
||||||
* For a distro-agnostic system-wide installation in the /etc directory, copy or link: 'vimrc' to '/etc/vimrc' and the 'vim' folder to '/etc/vim'.
|
* For a distro-agnostic system-wide installation in the /etc directory, copy or link: 'vimrc' to '/etc/vimrc' and the 'vim' folder to '/etc/vim'.
|
||||||
* For a single-user installation in a user's home directory, copy or link: 'vimrc' to '~/.vimrc' -and- the 'vim' folder to '~/.vim'.
|
* For a single-user installation in a user's home directory, copy or link: 'vimrc' to '~/.vimrc' -and- the 'vim' folder to '~/.vim'.
|
||||||
4. Make sure the 'vimrc' file and 'vim' folder are at least readable to any users that will be using the config.
|
4. Make sure the 'vimrc' file and 'vim' folder are readable by any users expecting to use them.
|
||||||
5. Clone additional vim plugin repos in the 'bundle' folder to have them loaded at startup.
|
5. Clone additional vim plugin repositories in the 'bundle' folder to have them loaded at startup.
|
||||||
6. You can add or replace config files in your 'vimrc' file to customize behaviour.
|
6. You can add additional config files or replace the included ones listed in the vimrc file to customize behaviour.
|
||||||
|
7. Run the 'gen-ctags-file' script to generate a tags file for the user that runs it to facilitate omnicompletion and tagbar.
|
||||||
7. Run the 'update' script in the base directory of the repo as an easy way to pull changes and update the plugins all at once.
|
7. Run the 'update' script in the base directory of the repo as an easy way to pull changes and update the plugins all at once.
|
||||||
8. You can find a list of keybindings that were added by this config as well as a few of the ones added by plugins in 'vim/config/keyboard.vim'
|
8. You can find a list of key bindings that were added by this config as well as a few of the ones added by plugins in 'vim/config/keyboard.vim'
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
3
generate-system-ctags
Executable file
3
generate-system-ctags
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
[[ `type -P ctags` ]] && ctags -R -f ~/.vim/tags /usr/include /usr/local/include || echo "Can't find the ctags binary in $PATH"
|
2
update
2
update
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
git pull origin
|
git pull origin
|
||||||
git submodule update --init
|
git submodule update --init --recursive --rebase
|
||||||
|
|
1
vim/bundle/gundo.vim
Submodule
1
vim/bundle/gundo.vim
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 3975ac871565115e3769dc69c06bc88ddc1369af
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit b0bb781fc73ef40365e4c996a16f04368d64fc9d
|
|
1
vim/bundle/syntastic
Submodule
1
vim/bundle/syntastic
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 82bff20b0200c3ccb292a9261d565b5bbc609ac2
|
1
vim/bundle/unite.vim
Submodule
1
vim/bundle/unite.vim
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 11c572564736dfbbebe8cdbbf3e2768ad80a083c
|
1
vim/bundle/vimfiler.vim
Submodule
1
vim/bundle/vimfiler.vim
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit d87231f66c042d8e6d139cd0ff71af91114af49d
|
|
@ -281,8 +281,8 @@ call s:X("StatusLineNC","ffffff","626262","","White","Grey")
|
||||||
call s:X("VertSplit","626262","626262","",s:termBlack,s:termBlack)
|
call s:X("VertSplit","626262","626262","",s:termBlack,s:termBlack)
|
||||||
call s:X("WildMenu","808080","303030","","White",s:termBlack)
|
call s:X("WildMenu","808080","303030","","White",s:termBlack)
|
||||||
|
|
||||||
call s:X("Folded","ffaf00","626262","bold","Red",s:termBlack)
|
call s:X("Folded","87d7ff","626262","bold","Blue",s:termBlack)
|
||||||
call s:X("FoldColumn","ffaf00","626262","bold","Red",s:termBlack)
|
call s:X("FoldColumn","87d7ff","262626","bold","Blue",s:termBlack)
|
||||||
call s:X("SignColumn","ffaf00","626262","bold","Red",s:termBlack)
|
call s:X("SignColumn","ffaf00","626262","bold","Red",s:termBlack)
|
||||||
call s:X("ColorColumn","ffaf00","626262","bold","Red",s:termBlack)
|
call s:X("ColorColumn","ffaf00","626262","bold","Red",s:termBlack)
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ call s:X("TabLineFill","","000000","","",s:termBlack)
|
||||||
call s:X("TabLineSel","000000","ffffff","",s:termBlack,"White")
|
call s:X("TabLineSel","000000","ffffff","",s:termBlack,"White")
|
||||||
|
|
||||||
call s:X("Comment","626262","","italic","Grey","")
|
call s:X("Comment","626262","","italic","Grey","")
|
||||||
call s:X("Todo","ffaf00","808080","","Red",s:termBlack)
|
call s:X("Todo","d75f5f","","bold","Red","")
|
||||||
|
|
||||||
call s:X("Normal","d0d0d0","262626","","White",s:termBlack)
|
call s:X("Normal","d0d0d0","262626","","White",s:termBlack)
|
||||||
call s:X("MatchParen","ffffff","262626","standout,bold",s:termBlack,"White")
|
call s:X("MatchParen","ffffff","262626","standout,bold",s:termBlack,"White")
|
||||||
|
@ -314,10 +314,10 @@ call s:X("PreProc","ffd787","","","Yellow","")
|
||||||
call s:X("Operator","d75f5f","","","Red","")
|
call s:X("Operator","d75f5f","","","Red","")
|
||||||
call s:X("NonText","87d7ff","","","Blue","")
|
call s:X("NonText","87d7ff","","","Blue","")
|
||||||
call s:X("SpecialKey","000000","","",s:termBlack,"")
|
call s:X("SpecialKey","000000","","",s:termBlack,"")
|
||||||
call s:X("Search","ffffff","d75f5f","bold","White","Red")
|
call s:X("Search","000000","87d7ff","bold",s:termBlack,"Blue")
|
||||||
call s:X("IncSearch","87d7ff","626262","standout","Blue","Grey")
|
call s:X("IncSearch","","","standout","","")
|
||||||
call s:X("Directory","ffaf00","","","Yellow","")
|
call s:X("Directory","87d7ff","","","Blue","")
|
||||||
call s:X("Question","d75f5f","","","Red","")
|
call s:X("Question","87d7ff","","","Blue","")
|
||||||
call s:X("ExtraWhitespace","262626","","standout",s:termBlack,"")
|
call s:X("ExtraWhitespace","262626","","standout",s:termBlack,"")
|
||||||
call s:X("Error","d75f5f","000000","standout","Red",s:termBlack)
|
call s:X("Error","d75f5f","000000","standout","Red",s:termBlack)
|
||||||
hi! link ErrorMsg Error
|
hi! link ErrorMsg Error
|
||||||
|
@ -409,9 +409,15 @@ call s:X("rubyGlobalVariable","","","bold","","")
|
||||||
"lua
|
"lua
|
||||||
hi! link luaOperator Conditional
|
hi! link luaOperator Conditional
|
||||||
|
|
||||||
""debugger.vim
|
"syntastic error checking
|
||||||
"call s:X("DbgCurrent","","","","","")
|
call s:X("SyntasticError","d75f5f","","standout,bold","Red","")
|
||||||
"call s:X("DbgBreakPt","","","","","")
|
call s:X("SyntasticWarning","ffd787","","standout,bold","Yellow","")
|
||||||
|
hi! link SyntasticErrorLine SyntasticError
|
||||||
|
hi! link SyntasticWarningLine SyntasticWarning
|
||||||
|
hi! link SyntasticErrorSign Error
|
||||||
|
hi! link SyntasticWarningSign Statement
|
||||||
|
hi! link qfSeparator Delimiter
|
||||||
|
hi! link qfLineNr SyntasticError
|
||||||
|
|
||||||
"vim-indent-guides
|
"vim-indent-guides
|
||||||
call s:X("IndentGuidesOdd","","7c7c7c","","","Grey")
|
call s:X("IndentGuidesOdd","","7c7c7c","","","Grey")
|
||||||
|
@ -469,11 +475,4 @@ hi! link TagListFileName Directory
|
||||||
let s:p.normal.error = [ [ s:red, s:base023 ] ]
|
let s:p.normal.error = [ [ s:red, s:base023 ] ]
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:base02 ] ]
|
let s:p.normal.warning = [ [ s:yellow, s:base02 ] ]
|
||||||
let g:lightline#colorscheme#darkcloud#palette = lightline#colorscheme#fill(s:p)
|
let g:lightline#colorscheme#darkcloud#palette = lightline#colorscheme#fill(s:p)
|
||||||
|
|
||||||
"theme config (powerline fonts)
|
|
||||||
if powerlinefonts == 1
|
|
||||||
let g:lightline = {'colorscheme': 'darkcloud', 'active': {'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'readonly', 'filename', 'modified' ] ]}, 'component': {'readonly': '%{&readonly?"":""}', 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}','fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'},'component_visible_condition': {'readonly': '(&filetype!="help"&& &readonly)','modified': '(&filetype!="help"&&(&modified||!&modifiable))', 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'}, 'separator': {'left': '', 'right': ''}, 'subseparator': {'left': '', 'right': ''}}
|
|
||||||
else
|
|
||||||
let g:lightline = {'colorscheme': 'darkcloud','active': {'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'readonly', 'filename', 'modified' ] ]},'component': {'readonly': '%{&readonly?"x":""}', 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'},'component_visible_condition': {'readonly': '(&filetype!="help"&& &readonly)','modified': '(&filetype!="help"&&(&modified||!&modifiable))', 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'},'separator': {'left': '', 'right': ''},'subseparator': {'left': '|', 'right': '|'}}
|
|
||||||
endif
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
|
@ -25,28 +25,30 @@
|
||||||
" <Ctrl-p> | (A) -> go to the previous open tab
|
" <Ctrl-p> | (A) -> go to the previous open tab
|
||||||
"
|
"
|
||||||
" (toggles)
|
" (toggles)
|
||||||
|
" <Space> | (N) -> toggle folds
|
||||||
" <F1> | (A) -> toggle line numbers
|
" <F1> | (A) -> toggle line numbers
|
||||||
" <F2> | (A) -> toggle row/column highlighting
|
" <F2> | (A) -> toggle row/column highlighting
|
||||||
" <F3> | (A) -> toggle spell check
|
" <F3> | (A) -> toggle line wrapping
|
||||||
" <F4> | (A) -> toggle line wrapping
|
" <F4> | (A) -> toggle spell check
|
||||||
" <F9> | (A) -> toggle the nerdtree sidebar
|
" <F5> | (A) -> toggle all folds
|
||||||
|
" <F9> | (A) -> toggle the gundo undo history sidebar
|
||||||
" <Shift-F9> | (A) -> toggle the tagbar sidebar
|
" <Shift-F9> | (A) -> toggle the tagbar sidebar
|
||||||
" <F12> | (A) -> toggle collapsed/folded rows
|
" <Ctrl-F9> | (A) -> toggle the error list
|
||||||
" <Shift-F12> | (A) -> toggle all folds
|
" `` | (N) -> toggle the filer explorer sidebar
|
||||||
" <Shift-F12> | (A) -> toggle all folds
|
|
||||||
"
|
"
|
||||||
" (gvim toggles)
|
" (gvim toggles)
|
||||||
" <Ctrl-F1> | (A) -> toggle the menu
|
" <Ctrl-F1> | (A) -> toggle the menu
|
||||||
" <Ctrl-F2> | (A) -> toggle the toolbar
|
" <Ctrl-F2> | (A) -> toggle the toolbar
|
||||||
" <Ctrl-F3> | (A) -> toggle the scrollbar
|
" <Ctrl-F3> | (A) -> toggle the scrollbar
|
||||||
"
|
"
|
||||||
" (spelling-and-completion)
|
" (completion)
|
||||||
" <Tab><Tab>, | (A) -> enter this following an emme 'word' (ie: html:5)
|
" <Leader>,, | (A) -> enter after emme 'word' (ie: html:5)
|
||||||
" \\ | (N) -> show spelling suggestions popup for word
|
" \\ | (N) -> show spelling suggestions popup for word
|
||||||
" \| | (N) -> add word to a local list of correct spellings
|
" \| | (N) -> add word to a local list of correct spellings
|
||||||
" <Leader><Backspace> | (N) -> undo the most recent match selection
|
" <Tab> | (I) -> (neocomp) autocomplete using common string
|
||||||
" <Tab> | (I) -> write the part common to all suggestions
|
" <Leader><Tab> | (I) -> (neocomp) autocomplete the common string
|
||||||
" <Backspace> | (I) -> cancel the match dialog (during suggestion)
|
" <Enter> | (I) -> (neocomp) close the suggestion popup
|
||||||
|
" <Leader><Backspace> | (I) -> (neocomp) undo the most recent completion
|
||||||
"
|
"
|
||||||
" (formatting)
|
" (formatting)
|
||||||
" <Backspace> | (V) -> deletes currently selected text
|
" <Backspace> | (V) -> deletes currently selected text
|
||||||
|
@ -82,7 +84,7 @@
|
||||||
" <Shift-Left> | (N) -> select all non-whitespace to the left
|
" <Shift-Left> | (N) -> select all non-whitespace to the left
|
||||||
"
|
"
|
||||||
" (vimdiff)
|
" (vimdiff)
|
||||||
" <Leader><Space> | (N) -> update differences
|
" <Leader>> | (N) -> update differences
|
||||||
" >> | (N) -> next difference
|
" >> | (N) -> next difference
|
||||||
" << | (N) -> previous difference
|
" << | (N) -> previous difference
|
||||||
" >< | (N) -> replace diff in current pane with other pane
|
" >< | (N) -> replace diff in current pane with other pane
|
||||||
|
@ -129,6 +131,9 @@
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"TOGGLES:{
|
"TOGGLES:{
|
||||||
|
"toggle folded code at foldpoints
|
||||||
|
nnoremap <Space> za
|
||||||
|
|
||||||
"unmap F1 from help then map it to toggle the display of line numbers
|
"unmap F1 from help then map it to toggle the display of line numbers
|
||||||
nnoremap <silent><expr> <F1> ':set number!<CR>'
|
nnoremap <silent><expr> <F1> ':set number!<CR>'
|
||||||
vnoremap <silent><expr> <F1> '<Esc>:set number!<CR>v'
|
vnoremap <silent><expr> <F1> '<Esc>:set number!<CR>v'
|
||||||
|
@ -139,33 +144,36 @@
|
||||||
vnoremap <silent><expr> <F2> '<Esc>:set cursorline! cursorcolumn!<CR>v'
|
vnoremap <silent><expr> <F2> '<Esc>:set cursorline! cursorcolumn!<CR>v'
|
||||||
inoremap <silent><expr> <F2> '<C-O>:set cursorline! cursorcolumn!<CR>'
|
inoremap <silent><expr> <F2> '<C-O>:set cursorline! cursorcolumn!<CR>'
|
||||||
|
|
||||||
"toggle spellcheck
|
|
||||||
nnoremap <silent><expr> <F3> ':set spell!<CR>'
|
|
||||||
vnoremap <silent><expr> <F3> '<Esc>:set spell!<CR>v'
|
|
||||||
inoremap <silent><expr> <F3> '<C-O>:set spell!<CR>'
|
|
||||||
|
|
||||||
"toggle line wrapping (and bottom bar if using the gui)
|
"toggle line wrapping (and bottom bar if using the gui)
|
||||||
nnoremap <silent><expr> <F4> ':set wrap! go'.'-+'[&wrap]."=b\r"
|
nnoremap <silent><expr> <F3> ':set wrap! go'.'-+'[&wrap]."=b\r"
|
||||||
vnoremap <silent><expr> <F4> '<Esc>:set wrap! go'.'-+'[&wrap]."=b\rv"
|
vnoremap <silent><expr> <F3> '<Esc>:set wrap! go'.'-+'[&wrap]."=b\rv"
|
||||||
inoremap <silent><expr> <F4> '<C-O>:set wrap! go'.'-+'[&wrap]."=b\r"
|
inoremap <silent><expr> <F3> '<C-O>:set wrap! go'.'-+'[&wrap]."=b\r"
|
||||||
|
|
||||||
"bindings to trigger the nerdtree and tagbar sidebars
|
"toggle spellcheck
|
||||||
nnoremap <silent><expr> <F9> ':NERDTreeToggle<CR>'
|
nnoremap <silent><expr> <F4> ':set spell!<CR>'
|
||||||
vnoremap <silent><expr> <F9> '<Esc>:NERDTreeToggle<CR>'
|
vnoremap <silent><expr> <F4> '<Esc>:set spell!<CR>v'
|
||||||
inoremap <silent><expr> <F9> '<Esc>:NERDTreeToggle<CR>'
|
inoremap <silent><expr> <F4> '<C-O>:set spell!<CR>'
|
||||||
|
|
||||||
|
"toggle all folds
|
||||||
|
nnoremap <F5> zi
|
||||||
|
vnoremap <F5> <Esc>ziv
|
||||||
|
inoremap <F5> <C-O>zi
|
||||||
|
|
||||||
|
"bindings to trigger the gundo undo history
|
||||||
|
nnoremap <silent><expr> <F9> ':GundoToggle<CR>'
|
||||||
|
vnoremap <silent><expr> <F9> '<Esc>:GundoToggle<CR>v'
|
||||||
|
inoremap <silent><expr> <F9> '<C-O>:GundoToggle<CR>'
|
||||||
|
|
||||||
|
"bindings to trigger the tagbar list of tags
|
||||||
nnoremap <silent><expr> <S-F9> ':TagbarToggle<CR>'
|
nnoremap <silent><expr> <S-F9> ':TagbarToggle<CR>'
|
||||||
vnoremap <silent><expr> <S-F9> '<Esc>:TagbarToggle<CR>v'
|
vnoremap <silent><expr> <S-F9> '<Esc>:TagbarToggle<CR>v'
|
||||||
inoremap <silent><expr> <S-F9> '<C-O>:TagbarToggle<CR>'
|
inoremap <silent><expr> <S-F9> '<C-O>:TagbarToggle<CR>'
|
||||||
|
|
||||||
"toggle folded code at foldpoints
|
"bindings to trigger the tagbar list of errors
|
||||||
nnoremap <F12> za
|
nmap <script> <silent> <C-F9> :call ToggleLocationList()<CR>
|
||||||
vnoremap <F12> <Esc>zav
|
|
||||||
inoremap <F12> <C-O>za
|
|
||||||
|
|
||||||
"toggle all folds
|
"bindings to trigger the filer explorer
|
||||||
nnoremap <S-F12> zi
|
nnoremap <silent><expr> `` ':VimFilerExplorer<CR>'
|
||||||
vnoremap <S-F12> <Esc>ziv
|
|
||||||
inoremap <S-F12> <C-O>zi
|
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"GVIM TOGGLES:{
|
"GVIM TOGGLES:{
|
||||||
|
@ -184,17 +192,21 @@
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"SPELLING AND COMPLETION:{
|
"SPELLING AND COMPLETION:{
|
||||||
"emmet switch triggerkey from <Ctrl-Y> to <Ctrl-Z>
|
"emmet switch triggerkey from <Ctrl-Y>
|
||||||
let g:user_emmet_leader_key='<Tab><Tab>'
|
let g:user_emmet_leader_key='<Leader>,'
|
||||||
|
|
||||||
"press backslash twice on a mispelled word for suggestions
|
"press backslash twice on a mispelled word for suggestions
|
||||||
nnoremap \\ hei<C-X><C-S>
|
nnoremap \\ hei<C-X><C-S>
|
||||||
nnoremap \| zg
|
nnoremap \| zg
|
||||||
|
|
||||||
"neocomplcache suggestions: cancel, autocomplete, scroll up and scroll down
|
"neocomplcache: scroll through completion list
|
||||||
inoremap <expr><Leader><Backspace> neocomplcache#undo_completion()
|
inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
inoremap <expr><Tab> pumvisible() ? neocomplcache#complete_common_string() : "\<Tab>"
|
"neocomplcache: complete the common part of the string
|
||||||
inoremap <expr><Backspace> pumvisible() ? neocomplcache#close_popup() : "\<Backspace>"
|
inoremap <expr><Leader><Tab> neocomplcache#complete_common_string()
|
||||||
|
"neocomplcache: close popup and delete backward char
|
||||||
|
inoremap <expr><CR> pumvisible() ? neocomplcache#smart_close_popup() : "\<CR>"
|
||||||
|
"neocomplcache : undo completion
|
||||||
|
inoremap <expr><Leader><Backspace> "<Backspace>" . neocomplcache#undo_completion()
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"FORMATTING:{
|
"FORMATTING:{
|
||||||
|
@ -244,7 +256,7 @@
|
||||||
|
|
||||||
"VIMDIFF:{
|
"VIMDIFF:{
|
||||||
"map shortcuts for vimdiff
|
"map shortcuts for vimdiff
|
||||||
nnoremap <silent><expr> <Leader><Space> ':diffu<CR>'
|
nnoremap <silent><expr> <Leader>> ':diffu<CR>'
|
||||||
nnoremap >> ]c
|
nnoremap >> ]c
|
||||||
nnoremap << [c
|
nnoremap << [c
|
||||||
nnoremap <> dp
|
nnoremap <> dp
|
||||||
|
@ -259,8 +271,8 @@
|
||||||
nnoremap y vy<Esc>
|
nnoremap y vy<Esc>
|
||||||
|
|
||||||
"alternatives that preserve the paste buffer
|
"alternatives that preserve the paste buffer
|
||||||
vnoremap p "_d"0P
|
vnoremap p "_dP
|
||||||
vnoremap P "_d"0P
|
vnoremap P "_dP
|
||||||
vnoremap <Leader>x "_x
|
vnoremap <Leader>x "_x
|
||||||
nnoremap <Leader>x "_x
|
nnoremap <Leader>x "_x
|
||||||
vnoremap <Leader>X "_X
|
vnoremap <Leader>X "_X
|
||||||
|
|
|
@ -2,42 +2,192 @@
|
||||||
" Plugins Configuration: "
|
" Plugins Configuration: "
|
||||||
"=========================="
|
"=========================="
|
||||||
|
|
||||||
"PATHOGEN BUNDLED EXTENSIONS PLUGIN: LOAD BUNDLED PLUGINS {{{"
|
"PATHOGEN BUNDLED EXTENSIONS PLUGIN: LOAD BUNDLED PLUGINS {{{
|
||||||
execute pathogen#infect()
|
execute pathogen#infect()
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"EMMET: CONFIGURE WHEN ZENCODING IS ENABLED {{{
|
"EMMET: CONFIGURE WHEN ZENCODING IS ENABLED {{{
|
||||||
let g:user_emmet_install_global = 0
|
let g:user_emmet_install_global=0
|
||||||
autocmd FileType html,css,php,aspx EmmetInstall
|
autocmd FileType html,css,php,aspx EmmetInstall
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
|
"GUNDO: CONFIGURE SIDEBAR SETTINGS {{{
|
||||||
|
let g:gundo_right=1
|
||||||
|
let g:gundo_width=50
|
||||||
|
let g:gundo_preview_height=20
|
||||||
|
"}}}
|
||||||
|
|
||||||
|
"LIGHTLINE: CONFIGURE THE LIGHTLINE STATUS BAR {{{
|
||||||
|
let g:unite_force_overwrite_statusline = 0
|
||||||
|
let g:vimfiler_force_overwrite_statusline = 0
|
||||||
|
|
||||||
|
function! LLModified()
|
||||||
|
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLReadonly()
|
||||||
|
return &ft !~? 'help' && &readonly ? 'RO' : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLFilename()
|
||||||
|
let fname = expand('%:t')
|
||||||
|
return
|
||||||
|
\ fname == '__Tagbar__' ? g:lightline.fname :
|
||||||
|
\ fname =~ '__Gundo' ? '' :
|
||||||
|
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||||
|
\ &ft == 'unite' ? unite#get_status_string() :
|
||||||
|
\ ('' != LLReadonly() ? LLReadonly() . ' ' : '') .
|
||||||
|
\ ('' != fname ? fname : '[No Name]') .
|
||||||
|
\ ('' != LLModified() ? ' ' . LLModified() : '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLFugitive()
|
||||||
|
try
|
||||||
|
if expand('%:t') !~? 'Tagbar\|Gundo' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||||
|
let mark = '' " edit here for cool mark
|
||||||
|
let _ = fugitive#head()
|
||||||
|
return strlen(_) ? mark._ : ''
|
||||||
|
endif
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLFileformat()
|
||||||
|
return winwidth(0) > 70 ? &fileformat : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLFiletype()
|
||||||
|
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLFileencoding()
|
||||||
|
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LLMode()
|
||||||
|
let fname = expand('%:t')
|
||||||
|
return fname == '__Tagbar__' ? 'Tagbar' :
|
||||||
|
\ fname == '__Gundo__' ? 'Gundo' :
|
||||||
|
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
|
||||||
|
\ &ft == 'unite' ? 'Unite' :
|
||||||
|
\ &ft == 'vimfiler' ? 'VimFiler' :
|
||||||
|
\ winwidth(0) > 60 ? lightline#mode() : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:tagbar_status_func = 'TagbarStatusFunc'
|
||||||
|
function! TagbarStatusFunc(current, sort, fname, ...) abort
|
||||||
|
let g:lightline.fname = a:fname
|
||||||
|
return lightline#statusline(0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
augroup AutoSyntastic
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWritePost * call s:syntastic()
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
function! s:syntastic()
|
||||||
|
SyntasticCheck
|
||||||
|
call lightline#update()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
"status bar config with and without powerline fonts
|
||||||
|
if powerlinefonts == 1
|
||||||
|
let g:lightline = {
|
||||||
|
\ 'colorscheme': 'darkcloud',
|
||||||
|
\ 'active': {
|
||||||
|
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ],
|
||||||
|
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||||
|
\ },
|
||||||
|
\ 'component_function': {
|
||||||
|
\ 'fugitive': 'LLFugitive',
|
||||||
|
\ 'filename': 'LLFilename',
|
||||||
|
\ 'fileformat': 'LLFileformat',
|
||||||
|
\ 'filetype': 'LLFiletype',
|
||||||
|
\ 'fileencoding': 'LLFileencoding',
|
||||||
|
\ 'mode': 'LLMode',
|
||||||
|
\ },
|
||||||
|
\ 'component_expand': {
|
||||||
|
\ 'syntastic': 'SyntasticStatuslineFlag',
|
||||||
|
\ },
|
||||||
|
\ 'component_type': {
|
||||||
|
\ 'syntastic': 'error',
|
||||||
|
\ },
|
||||||
|
\ 'separator': {'left': '', 'right': ''},
|
||||||
|
\ 'subseparator': {'left': '', 'right': ''}
|
||||||
|
\ }
|
||||||
|
else
|
||||||
|
let g:lightline = {
|
||||||
|
\ 'colorscheme': 'darkcloud',
|
||||||
|
\ 'active': {
|
||||||
|
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ],
|
||||||
|
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||||
|
\ },
|
||||||
|
\ 'component_function': {
|
||||||
|
\ 'fugitive': 'LLFugitive',
|
||||||
|
\ 'filename': 'LLFilename',
|
||||||
|
\ 'fileformat': 'LLFileformat',
|
||||||
|
\ 'filetype': 'LLFiletype',
|
||||||
|
\ 'fileencoding': 'LLFileencoding',
|
||||||
|
\ 'mode': 'LLMode',
|
||||||
|
\ },
|
||||||
|
\ 'component_expand': {
|
||||||
|
\ 'syntastic': 'SyntasticStatuslineFlag',
|
||||||
|
\ },
|
||||||
|
\ 'component_type': {
|
||||||
|
\ 'syntastic': 'error',
|
||||||
|
\ },
|
||||||
|
\ 'separator': {'left': '', 'right': ''},
|
||||||
|
\ 'subseparator': {'left': '|', 'right': '|'}
|
||||||
|
\ }
|
||||||
|
endif
|
||||||
|
"}}}
|
||||||
|
|
||||||
"MARKDOWN VIM MODE: SETTINGS {{{
|
"MARKDOWN VIM MODE: SETTINGS {{{
|
||||||
let g:vim_markdown_folding_disabled=0
|
let g:vim_markdown_folding_disabled=0
|
||||||
let g:vim_markdown_initial_foldlevel=2
|
let g:vim_markdown_initial_foldlevel=2
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"NEOCOMPLCACHE AUTOCOMPLETION PLUGIN: ENABLE, CONFIG AND SETUP OMNICOMPLETION {{{"
|
"VIM FILER: SETTINGS {{{
|
||||||
|
let g:vimfiler_edit_action='tabopen'
|
||||||
|
let g:vimfiler_as_default_explorer=1
|
||||||
|
let g:vimfiler_enable_auto_cd=1
|
||||||
|
|
||||||
|
let g:vimfiler_tree_closed_icon='▸'
|
||||||
|
let g:vimfiler_tree_opened_icon='▾'
|
||||||
|
let g:vimfiler_file_icon='-'
|
||||||
|
let g:vimfiler_marked_file_icon='+'
|
||||||
|
|
||||||
|
"edit files by double clicking them
|
||||||
|
autocmd FileType vimfiler nmap <buffer> <2-LeftMouse> <Plug>(vimfiler_edit_file)
|
||||||
|
|
||||||
|
"open automatically if vim was run without any files
|
||||||
|
autocmd VimEnter * if !argc() | VimFiler -project | endif
|
||||||
|
|
||||||
|
"file associations
|
||||||
|
if has('unix')
|
||||||
|
call vimfiler#set_execute_file('mp4','xdg-open')
|
||||||
|
call vimfiler#set_execute_file('mp3','xdg-open')
|
||||||
|
endif
|
||||||
|
"}}}
|
||||||
|
|
||||||
|
"NEOCOMPLCACHE AUTOCOMPLETION PLUGIN: ENABLE AND CONFIGURE BEHAVIOUR {{{
|
||||||
let g:neocomplcache_enable_at_startup=1
|
let g:neocomplcache_enable_at_startup=1
|
||||||
let g:neocomplcache_enable_smart_case=1
|
let g:neocomplcache_enable_smart_case=1
|
||||||
let g:neocomplcache_min_syntax_length=3
|
let g:neocomplcache_min_syntax_length=3
|
||||||
let g:neocomplcache_enable_insert_char_pre=1
|
let g:neocomplcache_enable_insert_char_pre=1
|
||||||
let g:neocomplcache_enable_underbar_completion=1
|
let g:neocomplcache_enable_underbar_completion=1
|
||||||
let g:neocomplcache_enable_camel_case_completion=1
|
|
||||||
let g:neocomplcache_wildcard_characters={'_': '-'}
|
let g:neocomplcache_wildcard_characters={'_': '-'}
|
||||||
|
|
||||||
if has("autocmd") && exists("+omnifunc")
|
if !exists('g:neocomplcache_omni_patterns')
|
||||||
autocmd Filetype * if &omnifunc == "" | setlocal omnifunc=syntaxcomplete#Complete | endif
|
let g:neocomplcache_omni_patterns = {}
|
||||||
|
endif
|
||||||
|
if !exists('g:neocomplcache_force_omni_patterns')
|
||||||
|
let g:neocomplcache_force_omni_patterns = {}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
autocmd FileType c setlocal omnifunc=ccomplete#Complete
|
let g:neocomplcache_omni_patterns.c='[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?'
|
||||||
autocmd FileType cpp setlocal omnifunc=omni#cpp#complete#Main
|
let g:neocomplcache_omni_patterns.cpp='[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
|
||||||
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
|
||||||
autocmd FileType ruby set omnifunc=rubycomplete#Complete
|
|
||||||
autocmd FileType php setlocal omnifunc=phpcomplete#CompletePHP
|
|
||||||
|
|
||||||
if !exists('g:neocomplcache_omni_patterns') | let g:neocomplcache_omni_patterns={} | endif
|
|
||||||
let g:neocomplcache_omni_patterns.c='[^.[:digit:] *\t]\%(\.\|->\)'
|
|
||||||
let g:neocomplcache_omni_patterns.cpp='[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
|
|
||||||
let g:neocomplcache_omni_patterns.xml='<[^>]*'
|
let g:neocomplcache_omni_patterns.xml='<[^>]*'
|
||||||
let g:neocomplcache_omni_patterns.html='<[^>]*'
|
let g:neocomplcache_omni_patterns.html='<[^>]*'
|
||||||
let g:neocomplcache_omni_patterns.xhtml='<[^>]*'
|
let g:neocomplcache_omni_patterns.xhtml='<[^>]*'
|
||||||
|
@ -47,7 +197,7 @@
|
||||||
let g:neocomplcache_omni_patterns.javascript='[^. \t]\.\%(\h\w*\)\?'
|
let g:neocomplcache_omni_patterns.javascript='[^. \t]\.\%(\h\w*\)\?'
|
||||||
let g:neocomplcache_omni_patterns.python='[^. *\t]\.\h\w*\|\h\w*::'
|
let g:neocomplcache_omni_patterns.python='[^. *\t]\.\h\w*\|\h\w*::'
|
||||||
let g:neocomplcache_omni_patterns.ruby='[^. *\t]\.\w*\|\h\w*::'
|
let g:neocomplcache_omni_patterns.ruby='[^. *\t]\.\w*\|\h\w*::'
|
||||||
let g:neocomplcache_omni_patterns.php='[^. \t]->\h\w*\|\h\w*::'
|
let g:neocomplcache_omni_patterns.php='[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
|
||||||
let g:neocomplcache_omni_patterns.actionscript='[^. \t][.:]\h\w*'
|
let g:neocomplcache_omni_patterns.actionscript='[^. \t][.:]\h\w*'
|
||||||
let g:neocomplcache_omni_patterns.python3='[^. *\t]\.\h\w*\|\h\w*::'
|
let g:neocomplcache_omni_patterns.python3='[^. *\t]\.\h\w*\|\h\w*::'
|
||||||
let g:neocomplcache_omni_patterns.go='\h\w*\%.'
|
let g:neocomplcache_omni_patterns.go='\h\w*\%.'
|
||||||
|
@ -55,9 +205,11 @@
|
||||||
let g:neocomplcache_omni_patterns.java='\%(\h\w*\|)\)\.'
|
let g:neocomplcache_omni_patterns.java='\%(\h\w*\|)\)\.'
|
||||||
let g:neocomplcache_omni_patterns.objc='\h\w\+\|\h\w*\%(\.\|->\)\h\w*'
|
let g:neocomplcache_omni_patterns.objc='\h\w\+\|\h\w*\%(\.\|->\)\h\w*'
|
||||||
let g:neocomplcache_omni_patterns.objj='[\[ \.]\w\+$\|:\w*$'
|
let g:neocomplcache_omni_patterns.objj='[\[ \.]\w\+$\|:\w*$'
|
||||||
let g:neocomplcache_omni_patterns.vimshell='\%(\\[^[:alnum:].-]\|[[:alnum:]@/.-_+,#$%~=*]\)\{2,}'
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"ASPNET ABSHIRE SYNTAX PLUGIN: {{{
|
"SYNTASTIC: CONFIGURE SYNTAX CHECKING {{{
|
||||||
au BufRead,BufNewFile *.aspx,*.asmx,*.ascx,*.master set syntax=aspnet
|
let g:syntastic_check_on_open=1
|
||||||
|
let g:syntastic_always_populate_loc_list=1
|
||||||
|
let g:syntastic_auto_loc_list=1
|
||||||
|
let g:syntastic_loc_list_height=5
|
||||||
"}}}
|
"}}}
|
||||||
|
|
|
@ -55,31 +55,35 @@
|
||||||
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
|
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
|
"FILETYPES AND SYNTAX: SETTINGS FOR FILETYPES AND ASSOCIATED SYNTAX {{{
|
||||||
"SYNTAX: INDENTING, HIGHLIGHTING, FOLDING {{{
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax on "turn syntax highlighting on
|
syntax on "turn syntax highlighting on
|
||||||
|
|
||||||
|
"set matching filenames to the given file types
|
||||||
|
autocmd BufNewFile,BufRead *.aspx,*.asmx,*.ascx,*.master setf aspnet
|
||||||
|
autocmd BufNewFile,BufRead *tmux.conf,pacman.conf,yaourtrc setf sh
|
||||||
|
autocmd BufNewFile,BufRead cjdroute.conf,ircd.conf setf javascript
|
||||||
|
|
||||||
|
"enable spellcheck by default when using given filetypes and extensions
|
||||||
|
autocmd FileType mail,gitcommit,mkd,text setl spell
|
||||||
|
|
||||||
|
"enable omnicompletion for any filetype without that has syntax highlighting
|
||||||
|
if has("autocmd") && exists("+omnifunc")
|
||||||
|
autocmd VimEnter,Filetype *
|
||||||
|
\ if &omnifunc == "" |
|
||||||
|
\ setlocal omnifunc=syntaxcomplete#Complete |
|
||||||
|
\ endif
|
||||||
|
endif
|
||||||
|
|
||||||
set formatoptions=roqnl12 "configure format options
|
set formatoptions=roqnl12 "configure format options
|
||||||
set foldmethod=syntax foldcolumn=1 foldlevel=3 "fold layers 3 or more deep
|
set foldmethod=syntax foldcolumn=1 foldlevel=3 "fold layers 3 or more deep
|
||||||
|
|
||||||
"disable folding by default in vimdiff
|
"disable folding by default in vimdiff
|
||||||
if &diff
|
if &diff
|
||||||
au VimEnter * windo set nofoldenable
|
autocmd VimEnter * windo set nofoldenable
|
||||||
endif
|
endif
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"FILETYPES: SETTINGS SPECIFIC TO A FILETYPE {{{
|
|
||||||
au FileType mail setl spell "enable spellcheck for e-mail (mutt)
|
|
||||||
au FileType gitcommit setl spell "enable spellcheck in git commits
|
|
||||||
au FileType mkd setl spell "enable spellcheck in markdown (ie: README.md)
|
|
||||||
au BufNewFile,BufRead *.txt setl spell "enable spellcheck for text files (*.txt)
|
|
||||||
au BufNewFile,BufRead *tmux.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
|
||||||
au BufNewFile,BufRead pacman.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
|
||||||
au BufNewFile,BufRead yaourtrc setf sh "set syntax for *tmux.conf to sh (bash)
|
|
||||||
au BufNewFile,BufRead cjdroute.conf setf javascript "set syntax for *cjdroute.conf to javascript
|
|
||||||
au BufNewFile,BufRead ircd.conf setf javascript "set syntax for *ircd.conf to javascript
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
"GVIM: GUI CONFIG OPTIONS {{{
|
"GVIM: GUI CONFIG OPTIONS {{{
|
||||||
set guicursor+=a:blinkon0 "disable the blinking cursor
|
set guicursor+=a:blinkon0 "disable the blinking cursor
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue