Tons of changes all in one commit because I'd broken a commit a while

back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
This commit is contained in:
Kevin 2014-04-04 19:49:02 -04:00
parent eae637b8c2
commit 85c17a68d7
9 changed files with 300 additions and 147 deletions

View file

@ -1,41 +1,56 @@
# Darkcloud Vim Theme, Config and Plugin Selection
# Darkcloud Vim Distribution: Theme, Config and Plugins #
## Requirements
## Requirements ##
1. Git: Required to clone and update the repository.
3. CTags: Available @ http://ctags.sourceforge.net, place in $PATH or the vim folder to use the tagbar or extended C omni/auto-completion.
1. Git: Required to clone and update the repository, and pull the plugins as submodules.
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.
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 an extended look/feel using lightline, otherwise it should be toggled off in the vimrc.
## Installation
## Features ##
1. Clone this repository then initialize and update the git submodules (in our case, the vim plugins)
* ]$ git clone https://github.com/prurigro/darkcloud-vimconfig.git
* ]$ cd darkcloud-vimconfig
* ]$ git submodule update --init
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 (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 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 readable by any users expecting to use them.
5. Clone additional vim plugin repositories in the 'bundle' folder to have them loaded at startup.
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.
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'
* A custom theme that includes an original colour scheme and an ever growing collection of explicit syntax colour overrides.
* A complete default configuration that attempts to provide a useful, easy to use and modern vim experience without becoming bloated.
* Key bindings and aliases to make useful features more accessible and provide a smoother work flow while attempting to vim's default behaviour while adding behaviour.
* A selection of plugins chosen either because they improve vim's support for common filetypes, or because they provide value-added features that aren't bloated and manage to make vim more useful as a text editor.
## Features
## Installation ##
* An original theme designed to be readable and aesthetically pleasing.
* A complete default configuration to start with and work from that aims to improve compatibility and provide sane, modern standards.
* Keyboard/mouse bindings that attempt to maintain vim's default behaviour while adding behaviour common to other text editors, improving accessibility to useful features, and making the mouse more capable (check the comments at the top of vim/config/keyboard.vim for a list of bindings and what they do).
* A core set of plugins that add some handy features and better support for some formats (you may want to remove plugins in vim/bundle/ supporting formats you won't be using).
1. Clone the darkcloud-vimconfig repo and use the __update__ script to install the plugins:
## Credits
`git clone https://github.com/prurigro/darkcloud-vimconfig.git`
`sh darkcloud-vimconfig/update`
* Note: The __update__ script requires bash, but you can enter the __darkcloud-vimconfig/__ folder and run: `git submodule update --init` to install the plugins manually if it's not available.
2. Open vim and run: `:version` to find the values for "user vimrc file" for a single-user install and "system vimrc file" for a system-wide install, then copy the vimrc file from `darkcloud-vimconfig/` to one of these locations.
3. Open the vimrc you just installed and edit the variables in the "USER CONFIG SETTINGS" section:
* **s:darkcloudpath**: Set to the location of the darkcloud-vimconfig folder. (default: __/etc/darkcloud-vimconfig__)
* **g:autostartchecker**: 1 = Check syntax once an appropriate file is loaded | 0 = Check syntax only after syntax checking is toggled on (default: 1)
* **g:powerlinefonts**: 1 = Render the statusline using characters available with powerline-patched fonts | 0 = Render the statusbar with less attractive but more compatible characters available in all fonts (default: 1)
* **guifont**: Set to the name of the font you would like to use with gVim followed by the size, making sure to escape spaces and that a powerline-compatible font is selected if the above option is set to 1. (default: Droid\ Sans\ Mono\ 12)
4. Install ctags (http://ctags.sourceforge.net) to your system using a package and ensure it can be accessed in __$PATH__, or install support for vim exclusively by copying the ctags binary to the __darkcloud-vimconfig/vim__ folder.
## Configuration ##
* **Custom Configuration**: Settings with priority over those set by darkcloud-vimconfig can be added to a file named __vimrc.user__, located in __darkcloud-vimconfig/vim/__ or any of the folders in the runtimepath.
* **Custom Plugins**: Pathogen compatible plugins can be cloned or extracted to "darkcloud-vimconfig/vim/bundle.user/", or a folder named "bundle" or "bundle.user" in any of the folders in the runtimepath.
* **Custom Snippets**: To add or override Emmet snippets, create __~/.vim/snippets.json__ and add your own definitions using json like shown in the [Emmet Documentation](http://docs.emmet.io/customization/snippets/).
* **File Associations**: To use the file manager in vim to run files with external programs, create "~/.vim/filetypes.vimcall" and on each line, write an association between a file extension and the program to launch files of that type that looks like: `call vimfiler#set_execute_file('mp4','xdg-open')`.
* **Update Script**: (requires: bash+git) Update the project and its submodules using the same "update" script in the root of darkcloud-vimconfig as the one used to download the plugins.
* **Generate System Tags**: (requires: bash+ctags) Generate a list of ctags for your system libraries in __/usr/include__ and __/usr/local/include__ as well as any folders passed as arguments by running the __gentags__ script.
* **Fix TMux Keys**: (requires: tmux): Add the following settings to tmux to ensure the colour scheme gets loaded and all the keyboard combinations work: `set -g default-terminal "screen-256color` and `set-window-option -g xterm-keys on`
## Notes ##
* Runtimepath: To find the runtimepath locations currently set, run the following in vim: `:verbose set runtimepath`.
* Key Bindings: You can find a list of the bindings added by darkcloud-vimconfig, as well as a few of the ones added by plugins in __vim/config/keyboard.vim__.
## Credits ##
* Written by prurigro: [GitHub Projects](https://github.com/prurigro) | [Arch Linux AUR Packages](https://aur.archlinux.org/packages/?SeB=m&K=prurigro)
* Many other authors have their work contained in this repo, most of which are self contained in the vim/bundle directory. I also used the Vim jellybean theme as a basis for the Darkcloud theme, which is maintained by NanoTech <http://nanotech.nanotechcorp.net/>
## License
## License ##
All projects cloned in the vim/bundle folder are separate and have their own licenses. Everything else is released under the MIT license.

View file

@ -1,3 +0,0 @@
#!/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"

3
gentags Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
[[ `type -P ctags` ]] && echo ctags -R -f ~/.vim/tags /usr/include /usr/local/include $@ || echo "Can't find the ctags binary in $PATH"

13
update
View file

@ -1,4 +1,17 @@
#!/usr/bin/env bash
cd "${0%/*}"
git pull origin
git submodule update --init --recursive
[[ -f .gitmodules ]] && for each in vim/bundle/*; do
if [ -d "$each" ]; then
if [ -f "${each}/.git" ]; then
FILE=$(echo $each | grep -o -e "[^\/]*$")
[[ `cat .gitmodules | grep "path = " | grep -o -e "[^\/]*$" | grep -c "${FILE}"` = 0 ]] && (rm -rf "${each}" && echo "Deleted: ${each}" || (echo -e "\033[01;31mWARNING\033[00m: '${each}' was removed upstream but couldn't be deleted here.\n\nPlease delete ${each} manually."; exit 1))
fi
fi
done
exit 0

View file

@ -8,13 +8,14 @@
"========================"
"
" Acknowledgements:
"
" I found the jellybeans theme part way through creating
" this one and liked how it scripted compatibility between
" cterm and gui, so I stripped its colours and ported
" my own in, using jellybeans as a functional template.
"
" As referenced in the original jellybean theme, the set
" of color approximation functions were creaed by Henry
" of color approximation functions were created by Henry
" So, Jr. and David Liang
"
@ -32,7 +33,7 @@ endif
let colors_name = "darkcloud"
"color approximation funcionality{{{
"color approximation functionality {{{
"approximate the grey index from a given grey level
fun! s:grey_number(x)
if &t_Co == 88
@ -266,59 +267,84 @@ else
let s:termBlack = "Grey"
endif
"SPELL CHECKING UNDERLINE: (blue, yellow, none, none)
hi SpellBad guisp=#87d7ff gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=bold,underline cterm=bold,underline
hi SpellCap guisp=#ffd787 gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellRare guisp=NONE gui=NONE guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=NONE cterm=NONE
hi SpellLocal guisp=NONE gui=NONE guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=NONE cterm=NONE
"SYNTAX COLORS:
"format:
"format: ('name','fg ','bg ','style ',s:lowcolor-fg,'lowcolor-bg')
"example:('Line','000000','f0f0f0','italic,bold',s:termBlack ,'White')
call s:X("Visual","","262626","standout","",s:termBlack)
call s:X("Cursor","","262626","standout,underline","",s:termBlack)
hi! link MatchParen Cursor
"core style
call s:X("Normal","eaeaea","262626","","White",s:termBlack)
hi Normal ctermfg=254 ctermbg=235
call s:X("Cursor","","262626","standout,underline,bold",s:termBlack,"White")
call s:X("CursorColumn","","303030","","",s:termBlack)
hi CursorColumn ctermbg=236
call s:X("CursorLine","","303030","","",s:termBlack)
hi CursorLine ctermbg=236
call s:X("CursorLineNr","87d7ff","303030","bold","Blue",s:termBlack)
hi CursorLineNr ctermbg=236
call s:X("LineNr","4e4e4e","","bold","White",s:termBlack)
hi LineNr ctermfg=239
call s:X("Visual","","262626","standout","",s:termBlack)
call s:X("MatchParen","ffffff","","bold,underline","","")
"whitespace
call s:X("TabLine","","000000","","",s:termBlack)
call s:X("TabLineFill","","000000","","",s:termBlack)
call s:X("TabLineSel","000000","d0d0d0","",s:termBlack,"White")
call s:X("ExtraWhitespace","262626","","standout",s:termBlack,"")
"menu call
call s:X("Pmenu","87d7ff","303030","","Grey","Blue")
call s:X("PmenuSel","87d7ff","4e4e4e","bold","White","Black")
"search
call s:X("Search","87d7ff","262626","standout","Blue",s:termBlack)
call s:X("IncSearch","87d7ff","262626","standout,bold","Blue",s:termBlack)
"status line
call s:X("StatusLine","000000","d75f5f","bold",s:termBlack,"Red")
call s:X("StatusLineNC","ffffff","626262","","White","Grey")
call s:X("VertSplit","626262","626262","",s:termBlack,s:termBlack)
call s:X("WildMenu","808080","303030","","White",s:termBlack)
call s:X("Folded","87d7ff","626262","bold","Blue",s:termBlack)
call s:X("FoldColumn","87d7ff","262626","bold","Blue",s:termBlack)
call s:X("SignColumn","ffaf00","262626","bold","Red",s:termBlack)
"folding
call s:X("Folded","87d7ff","4e4e4e","bold","Blue",s:termBlack)
call s:X("FoldColumn","87d7ff","","bold","Blue","")
call s:X("SignColumn","ffaf00","","bold","Red","")
hi! link ColorColumn SignColumn
call s:X("TabLine","","000000","","",s:termBlack)
call s:X("TabLineFill","","000000","","",s:termBlack)
call s:X("TabLineSel","000000","d0d0d0","",s:termBlack,"White")
call s:X("Comment","626262","","italic","Grey","")
call s:X("Todo","d75f5f","","bold","Red","")
call s:X("Normal","eaeaea","262626","","White",s:termBlack)
call s:X("CursorColumn","","303030","","",s:termBlack)
call s:X("CursorLine","","303030","","",s:termBlack)
call s:X("CursorLineNr","87d7ff","","bold","Blue",s:termBlack)
call s:X("LineNr","ffaf00","","","Yellow",s:termBlack)
"syntax style
call s:X("Title","d75f5f","","underline","Red","")
call s:X("Comment","6c6c6c","","italic","Grey","")
call s:X("Constant","87d7ff","","bold","Blue","")
call s:X("Special","ffaf00","","","Yellow","")
call s:X("Special","ffd787","","bold","Yellow","")
call s:X("Delimiter","ffffff","","","White","")
call s:X("String","ffffff","","italic","White","")
call s:X("StringDelimiter","d0d0d0","","","White","")
call s:X("Identifier","87d7ff","","","Blue","")
call s:X("Identifier","87d7ff","","bold","Blue","")
call s:X("Type","d75f5f","","bold","Red","")
call s:X("Function","87d7ff","","","Blue","")
call s:X("Label","d75f5f","","","Red","")
call s:X("Statement","ffd787","","","Yellow","")
call s:X("PreProc","ffd787","","","Yellow","")
call s:X("Keyword","ffd787","","bold","Yellow","")
call s:X("Operator","d75f5f","","","Red","")
call s:X("NonText","87d7ff","","","Blue","")
call s:X("SpecialKey","626262","","",s:termBlack,"")
call s:X("Search","87d7ff","262626","standout","Blue",s:termBlack)
call s:X("IncSearch","87d7ff","262626","standout,bold","Blue",s:termBlack)
call s:X("Directory","87d7ff","","","Blue","")
call s:X("Question","87d7ff","","","Blue","")
call s:X("ExtraWhitespace","262626","","standout",s:termBlack,"")
call s:X("Todo","d75f5f","","bold","Red","")
"errors
call s:X("Error","d75f5f","000000","standout","Red",s:termBlack)
hi! link WarningMsg Error
hi! link ErrorMsg Error
@ -326,13 +352,7 @@ hi! link MoreMsg Special
hi! link Structure PreProc
hi! link Number Type
"spell checking
call s:X("SpellBad","d75f5f","","undercurl","","Red")
call s:X("SpellCap","87d7ff","","undercurl","","Blue")
call s:X("SpellLocal","ffd787","","undercurl","","Yellow")
call s:X("SpellRare","ffffff","","italic","White","")
"diff
"vimdiff
hi! link diffRemoved Constant
hi! link diffAdded String
call s:X("DiffAdd","000000","ffd787","italic",s:termBlack,"Yellow")
@ -340,11 +360,14 @@ call s:X("DiffDelete","000000","d75f5f","italic",s:termBlack,"Red")
call s:X("DiffChange","000000","87d7ff","italic",s:termBlack,"Blue")
call s:X("DiffText","000000","c6c6c6","italic",s:termBlack,"White")
"git
hi! link gitconfigAssignment Label
"html
call s:X("htmlTitle","ffffff","","underline,bold","White","")
call s:X("htmlH1","d75f5f","262626","underline,bold","Red","")
call s:X("htmlH2","ffd787","262626","underline,bold","Yellow","")
call s:X("htmlH3","87d7ff","262626","underline,bold","Blue","")
call s:X("htmlH1","d75f5f","","underline,bold","Red","")
call s:X("htmlH2","ffd787","","underline,bold","Yellow","")
call s:X("htmlH3","87d7ff","","underline,bold","Blue","")
call s:X("htmlH4","d75f5f","","underline","Red","")
call s:X("htmlH5","ffd787","","underline","Yellow","")
call s:X("htmlH6","87d7ff","","underline","Blue","")
@ -415,12 +438,14 @@ call s:X("rubyGlobalVariable","","","bold","","")
"lua
hi! link luaOperator Conditional
"vim-indent-guides
"vim config/vimscript
call s:X("IndentGuidesOdd","","7c7c7c","","","Grey")
call s:X("IndentGuidesEven","","1c1c1c","","",s:termBlack)
if !exists("g:indent_guides_auto_colors")
let g:indent_guides_auto_colors=0
endif
call s:X("vimOperParen","87d7ff","","","Blue","")
"notes
call s:X("notesRule","","","bold","","")

View file

@ -11,13 +11,25 @@
" *The default <Leader> key is: \
"
" Reference: (view plugin documentation for the full list of commands each offers)
" <Leader>q | (N) -> toggle display of the quickfix list
" <Leader>l | (N) -> toggle display of the location list
" (tcomment _ can also be -)
" <Ctrl-_><Ctrl-_> | (A) -> comment selection/create an empty comment
" <Ctrl-_>b | (A) -> comment the current block(s)
" <Ctrl-_>r | (A) -> comment everything on the line to the right
" <Ctrl-_>p | (A) -> comment the current paragraph
"
" (surround)
" S" | (V) -> surround selection with quotes
" S<a href=""> | (V) -> surround <a href="">selection</a>
" ds" | (N) -> delete surrounding ""
" dst | (N) -> delete surrounding tag (ie: <strong></strong>)
" cs'" | (N) -> change surrounding '' to "" (any delimiters work)
" cs"<q> | (N) -> change surrounding "" to the tag: <q></q>
" cst" | (N) -> change any surrounding tag to ""
"
" (vim)
" D | (N) -> delete/cut to the end of the line
" S | (N) -> delete/cut a line up to the whitespace
"
" Mappings:
" (mouse)
" <Ctrl-ScrollUp> | (A) -> scroll right
@ -25,14 +37,15 @@
" <Shift-MiddleClick> | (A) -> unbind this from vim so xorg can paste
"
" (tabs)
" <Ctrl-n> | (A) -> go to the next open tab
" <Ctrl-p> | (A) -> go to the previous open tab
" <Ctrl-t> | (A) -> open a new tab
" `<Ctrl-t> | (N) -> create a new tab with vimfiler
" <Leader>9 | (A) -> go to the next open tab
" <Leader>0 | (A) -> go to the previous open tab
" <Leader>- | (A) -> open a new tab
" <Leader>= | (A) -> create a new tab with vimfiler
" <Leader>+ | (A) -> create a new tab with vimfiler
"
" (toggles)
" `` | (N) -> toggle the vimfiler sidebar on the left
" ~~ | (N) -> toggle the vimfiler sidebar on the right
" `` | (N) -> toggle the vimfiler sidebar on the right
" ~~ | (N) -> toggle the vimfiler sidebar on the left
" <Space> | (N) -> toggle folds
" <F1> | (A) -> toggle line numbers
" <F2> | (A) -> toggle row/column cursor highlighting
@ -40,10 +53,10 @@
" <F4> | (A) -> toggle all folds
" <F5> | (A) -> toggle spell check
" <F6> | (A) -> toggle syntax checking
" <F8> | (A) -> enable spellcheck + toggle list of spelling errors
" <F8> | (A) -> toggle the tagbar sidebar
" <Ctrl-F8> | (A) -> toggle the location list to check syntax errors
" <F9> | (A) -> toggle the gundo undo history sidebar
" <Shift-F9> | (A) -> toggle the tagbar sidebar
" <Ctrl-F9> | (A) -> toggle the location/error list
" <Ctrl-F9> | (A) -> enable spellcheck & toggle list of spelling errors
"
" (gvim toggles)
" <Ctrl-F1> | (A) -> toggle the menu
@ -62,7 +75,8 @@
" (formatting)
" <Backspace> | (V) -> deletes currently selected text
" <Backspace> | (N) -> deletes the character behind the cursor
" <Leader><C-f> | (N) -> format document and return to current line
" <Leader><C-f> | (V) -> format the selection and return to cursor
" <Leader><C-f> | (N) -> format document and return to cursor
" <Leader><C-w> | (N) -> remove whitespace
" <Leader><C-t> | (N) -> convert tabs into spaces
" <Leader>\ | (N) -> remove search highlighting
@ -126,6 +140,28 @@
" <Leader>dw | (N) -> delete chars under and after the cursor in the word
" <Leader>dd | (N) -> delete lines under and after the one below
"
" Filetype Specific Mappings:
" (gundo)
" <LMouse> | (A) -> same as normal + justify one from the left
" <MMouse> | (A) -> same as the left mouse
" <RMouse> | (A) -> same as the left mouse
" <Right> | (A) -> same as j (down)
" l | (A) -> same as j (down)
" <Left> | (A) -> same as k (up)
" h | (A) -> same as k (up)
"
" (vimfiler)
" <Shift-Return> | (A) -> edit the selected file
" <LMouse><LMouse> | (A) -> edit selected file
" <Right> | (A) -> map to l, which opens a directory
" <Left> | (A) -> map to h, which goes up one directory
" <LMouse> | (A) -> same as normal + justify on the left
" <MMouse> | (A) -> same as the left mouse
" <RMouse> | (A) -> same as the left mouse
"
" (vimfiler,gundo)
"
"
" Aliases:
" :wsudo -and- :sudow | (C) -> :SudoWrite (write the file as root using sudo)
" :esudo -and- :sudoe | (C) -> :SudoRead (read a file as root using sudo)
@ -145,16 +181,27 @@
"}
"TABS:{
nnoremap <silent><expr> <C-n> ':tabnext<CR>'
nnoremap <silent><expr> <C-p> ':tabprev<CR>'
nnoremap <silent><expr> <C-t> ':tabnew<CR>'
nnoremap <silent><expr> `<C-t> ':VimFiler -tab -project<CR>'
nnoremap <silent><expr> <Leader>0 ':tabnext<CR>'
inoremap <silent><expr> <Leader>0 '<C-O>:tabnext<CR>'
xnoremap <silent><expr> <Leader>0 '<Esc>:tabnext<CR>'
nnoremap <silent><expr> <Leader>9 ':tabprev<CR>'
inoremap <silent><expr> <Leader>9 '<Esc>:tabprev<CR>'
xnoremap <silent><expr> <Leader>9 '<Esc>:tabprev<CR>'
nnoremap <silent><expr> <Leader>- ':tabnew<CR>'
inoremap <silent><expr> <Leader>- '<Esc>:tabnew<CR>'
xnoremap <silent><expr> <Leader>- '<Esc>:tabnew<CR>'
nnoremap <silent><expr> <leader>= ':VimFiler -tab -project<CR>'
inoremap <silent><expr> <leader>= '<Esc>:VimFiler -tab -project<CR>'
xnoremap <silent><expr> <leader>= '<Esc>:VimFiler -tab -project<CR>'
nnoremap <silent><expr> <leader>+ ':VimFiler -tab -project -double<CR>'
inoremap <silent><expr> <leader>+ '<Esc>:VimFiler -tab -project -double<CR>'
xnoremap <silent><expr> <leader>+ '<Esc>:VimFiler -tab -project -double<CR>'
"}
"TOGGLES:{
"bindings to trigger vimfiler
nnoremap <silent><expr> `` ':VimFilerExplorer -direction=topleft -winwidth=45<CR>'
nnoremap <silent><expr> ~~ ':VimFilerExplorer -direction=botright -winwidth=45<CR>'
nnoremap <silent><expr> `` ':VimFilerExplorer -direction=botright -winwidth=45<CR>'
nnoremap <silent><expr> ~~ ':VimFilerExplorer -direction=topleft -winwidth=45<CR>'
"toggle folded code at foldpoints
nnoremap <Space> za
@ -189,23 +236,23 @@
xnoremap <silent><expr> <F6> '<Esc>:SyntasticToggleMode<CR>v'
inoremap <silent><expr> <F6> '<C-O>:SyntasticToggleMode<CR>'
"bindings to trigger spellcheck
nnoremap <silent><expr> <F8> ':UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
xnoremap <silent><expr> <F8> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
inoremap <silent><expr> <F8> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
"bindings to trigger the tagbar list of tags
nnoremap <silent><expr> <F8> ':TagbarToggle<CR>:echo "Code tagbar toggled"<CR>'
xnoremap <silent><expr> <F8> '<Esc>:TagbarToggle<CR>v'
inoremap <silent><expr> <F8> '<C-O>:TagbarToggle<CR>'
"bindings to trigger the tagbar list of errors
nmap <script> <silent> <C-F8> :call ToggleLocationList()<CR>:echo "Error/Location list toggled"<CR>
"bindings to trigger the gundo undo history
nnoremap <silent><expr> <F9> ':GundoToggle<CR>:echo "Undo history sidebar toggled"<CR>'
xnoremap <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>:echo "Code tagbar toggled"<CR>'
xnoremap <silent><expr> <S-F9> '<Esc>:TagbarToggle<CR>v'
inoremap <silent><expr> <S-F9> '<C-O>:TagbarToggle<CR>'
"bindings to trigger the tagbar list of errors
nmap <script> <silent> <C-F9> :call ToggleLocationList()<CR>:echo "Error/Location list toggled"<CR>
"bindings to trigger spellcheck
nnoremap <silent><expr> <C-F9> ':UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
xnoremap <silent><expr> <C-F9> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
inoremap <silent><expr> <C-F9> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
"}
"GVIM TOGGLES:{
@ -225,7 +272,7 @@
"COMPLETION:{
"emmet switch triggerkey from <Ctrl-Y>
let g:user_emmet_leader_key='<Leader>,'
let g:user_emmet_leader_key='<C-\>'
"press backslash twice on a mispelled word for suggestions
nnoremap \\ hei<C-X><C-S>
@ -248,6 +295,7 @@
"formatting options to apply to the whole document
nnoremap <Leader><C-f> mzgg=G`z<CR>:echo "The document has been formatted"<CR>
vnoremap <Leader><C-f> mz=`z<CR>:echo "The selection has been formatted"<CR>
nnoremap <silent><expr> <Leader><C-w> ':FixWhitespace<CR>:echo "Trailing whitespace has been removed"<CR>'
nnoremap <silent><expr> <Leader><C-t> ':retab<CR>:noh<CR>:echo "Tabs have been converted to spaces"<CR>'
nnoremap <silent><expr> <Leader>/ ':noh<CR>:echo "Search results have been cleared"<CR>'
@ -281,7 +329,7 @@
"ctrl-a to select all (and an alt for screen users)
nnoremap <C-a> gg0vG$
xnoremap <C-a> <Esc>gg0vG$
xnoremap <Leader>a <Esc>gg0vG$
nnoremap <Leader>a <Esc>gg0vG$
xnoremap <Leader>a gg0vG$
"map remap keys for speedier text selection
@ -317,7 +365,7 @@
"P puts text it replaces in the buffer and p does not
vnoremap P p
xmap p <Plug>ReplaceWithRegisterVisual
nmap <Leader>p <Plug>ReplaceWithRegisterOperator
nmap <C-p> <Plug>ReplaceWithRegisterOperator
"Alternatives to deletion commands that don't replace the buffer
vnoremap <Leader>x "_x
@ -332,6 +380,50 @@
"}
"}}}
"FILETYPE SPECIFIC MAPPINGS: {{{
"gundo
autocmd FileType gundo noremap <buffer> <LeftMouse> <LeftMouse>0l
autocmd FileType gundo noremap <buffer> <MiddleMouse> <LeftMouse>
autocmd FileType gundo noremap <buffer> <RightMouse> <LeftMouse>
autocmd FileType gundo noremap <buffer> <Right> j
autocmd FileType gundo noremap <buffer> l j
autocmd FileType gundo noremap <buffer> <Left> k
autocmd FileType gundo noremap <buffer> h k
"vimfiler
autocmd FileType vimfiler noremap <buffer> <Right> l
autocmd FileType vimfiler noremap <buffer> <Left> h
autocmd FileType vimfiler noremap <buffer> <2-LeftMouse> <Plug>(vimfiler_edit_file)
autocmd FileType vimfiler noremap <buffer> <LeftMouse> <LeftMouse>0
autocmd FileType vimfiler noremap <buffer> <MiddleMouse> <LeftMouse>
autocmd FileType vimfiler noremap <buffer> <RightMouse> <LeftMouse>
autocmd FileType vimfiler noremap <S-CR> e
"}}}
"DISABLED MAPPINGS: {{{
"remove incompatible toggles from gundo and filer
autocmd Filetype gundo,vimfiler noremap <F1> <Nop>
autocmd Filetype gundo,vimfiler noremap <F2> <Nop>
autocmd Filetype gundo,vimfiler noremap <F3> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-Up> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-k> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-Down> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-j> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-Right> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-l> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-Left> <Nop>
autocmd Filetype gundo,vimfiler noremap <C-h> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-Up> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-k> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-Down> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-j> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-Right> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-l> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-Left> <Nop>
autocmd Filetype gundo,vimfiler noremap <S-h> <Nop>
"}}}
"ALIASES: COMMAND SHORTCUTS {{{
cabbrev sudow SudoWrite
cabbrev wsudo SudoWrite

View file

@ -8,18 +8,27 @@
"=========================="
"PATHOGEN BUNDLED EXTENSIONS PLUGIN: LOAD BUNDLED PLUGINS {{{
execute pathogen#infect()
execute pathogen#infect('bundle/{}', 'bundle.user/{}')
"}}}
"EMMET: CONFIGURE WHEN ZENCODING IS ENABLED {{{
let g:user_emmet_install_global=0
let g:use_emmet_complete_tag=1
let g:user_emmet_mode='a'
autocmd FileType html,css,php,aspx EmmetInstall
if filereadable("~/.vim/snippets.json")
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.vim/snippets.json')), "\n"))
endif
"}}}
"GUNDO: CONFIGURE SIDEBAR SETTINGS {{{
let g:gundo_right=1
let g:gundo_width=35
let g:gundo_preview_height=10
autocmd FileType gundo setlocal nocursorcolumn
"}}}
"LIGHTLINE: CONFIGURE THE LIGHTLINE STATUS BAR {{{
@ -97,7 +106,7 @@
endfunction
"status bar config with and without powerline fonts
if (powerlinefonts == 1)
if (g:powerlinefonts == 1)
let g:lightline = {
\ 'colorscheme': 'darkcloud',
\ 'active': {
@ -154,7 +163,7 @@
"}}}
"SYNTASTIC: CONFIGURE SYNTAX CHECKING {{{
if (autochecksyntax == 1)
if (g:autostartchecker == 1)
let g:syntastic_mode_map = {'mode':'active','active_filetypes':[],'passive_filetypes':[]}
let g:syntastic_check_on_open=1
else
@ -180,22 +189,16 @@
let g:vimfiler_marked_file_icon='+'
"edit files by double clicking them, and justify the cursor on the left
autocmd FileType vimfiler nmap <buffer> <2-LeftMouse> <Plug>(vimfiler_edit_file)
autocmd FileType vimfiler nmap <buffer> <LeftMouse> <LeftMouse>0
autocmd FileType vimfiler nmap <buffer> <MiddleMouse> <LeftMouse>0
autocmd FileType vimfiler nmap <buffer> <RightMouse> <LeftMouse>0
autocmd FileType vimfiler nmap <buffer> <Right> l
autocmd FileType vimfiler nmap <buffer> <Left> h
autocmd FileType vimfiler setlocal nonumber wrap
autocmd FileType vimfiler setlocal nocursorcolumn
"open automatically if vim was run without any files
autocmd VimEnter * if !argc() | VimFiler -quit -project | endif
"filetype associations (just a sample to show how it can work)
"if has('unix')
"call vimfiler#set_execute_file('mp4','xdg-open')
"endif
"load the list of file extensions and handlers if it exists
if filereadable(glob("~/.vim/filetypes.vim"))
source ~/.vim/filetypes.vim
endif
"}}}
"NEOCOMPLCACHE AUTOCOMPLETION PLUGIN: ENABLE AND CONFIGURE BEHAVIOUR {{{

View file

@ -30,10 +30,9 @@
set number "enable line numbers
set nowrap "disable line wrapping
set cursorline cursorcolumn "enable row/column highlighting
set selection=exclusive "when highlighting, don't select the position under the cursor
set visualbell "notify visually instead of with an audible bell
set splitright "add new tiles on the right (and not left) when added
set scrolloff=1 sidescrolloff=1 "start scrolling if the cursor is one position away from the edge
set scrolloff=0 sidescrolloff=0 "start scrolling if the cursor is one position away from the edge
set list listchars=tab:>-,trail:- "display tabs as: >--- and trailing spaces as: -
set autochdir "current dir is file dir
set history=250 "undo history

76
vimrc
View file

@ -1,44 +1,50 @@
"==============="
" "
" Vim Config: "
" "
"==============="
"========================================"
" "
" Darkcloud Vim Config: "
" vimrc "
" "
" Maintainer: Prurigro "
" License: MIT "
" "
"========================================"
"
" Notes:
" Tmux requires the '-2' flag to be set when
" launched for vim to use more than just the
" set of terminal colours.
"
" The ctags package should be downloaded from
" http://ctags.sourceforge.net and installed
" to $PATH
"
" To use lightline with powerline fonts, set
" powerlinefonts=1 below, and ensure guifont is
" set to a powerline patched font. For example:
" guifont=Droid\ Sans\ Mono\ for\ Powerline\ 12
"Powerline Font Support: (1:enabled, 0:disabled)
let powerlinefonts=1
"USER CONFIG SETTINGS: {{{
"Darkcloud Vim Folder:
let s:darkcloudpath="/etc/darkcloud-vimconfig"
"Syntax Checking Enabled: (1:enabled, 0:must be toggled on)
let autochecksyntax=1
"Start With Syntax Checking: (1:start toggled on, 0:start toggled off)
let g:autostartchecker=1
"GVim Font Selection: (term font set by terminal)
set guifont=Droid\ Sans\ Mono\ 12
"Powerline Font Support: (1:enabled, 0:disabled)
let g:powerlinefonts=1
"Add Config Directory: (distro-agnostic system-wide)
set runtimepath+=/etc/vim,/etc/vim/after
"GVim Font Selection: (term font set by terminal)
set guifont=Droid\ Sans\ Mono\ 12
"}}}
"Load Settings:
runtime config/settings.vim
"LOAD DARKCLOUD CONFIG AND THEME FILES: {{{
"Add Config Directory: (distro-agnostic system-wide)
let &runtimepath=printf('%s,%s/vim,%s/vim/after',&runtimepath,s:darkcloudpath,s:darkcloudpath)
"Load Plugins:
runtime bundle/vim-pathogen/autoload/pathogen.vim
runtime config/plugins.vim
"Load Settings:
runtime config/settings.vim
"Configure Keymappings:
runtime config/keyboard.vim
"Load Plugins:
runtime bundle/vim-pathogen/autoload/pathogen.vim
"Load Theme:
colorscheme darkcloud
"Load Plugin Configuration:
runtime config/plugins.vim
"Load Keymappings:
runtime config/keyboard.vim
"Load Colour Scheme:
colorscheme darkcloud
"}}}
"LOAD USER CONFIG FILE: {{{
if filereadable($VIMRUNTIME."/vimrc.user")
runtime vimrc.user
endif
"}}}