Quellcode durchsuchen

Add Alduin vim colorscheme, add dirvish `mc` mapping

Alduin is now the default colourscheme in new installations as degraded
Solarized is not nice to look at.

`mc` in a dirvish buffer now brings up a command to create a file in the
current directory.
Weiyi Lou vor 9 Jahren
Ursprung
Commit
910bbe6fde

+ 1 - 1
.gitignore

@@ -3,9 +3,9 @@ vim/.netrwhist
 vim/autoload/plug.vim.old
 vim/current-colour
 vim/plugged
+vim/snippets
 vim/spell
 vim/use-solarized-palette
-vim/snippets
 
 # Vimperator
 vimperator/info

+ 2 - 2
README.md

@@ -61,7 +61,7 @@ Below is a non-exhaustive list of dotfiles usage.
 
 - `<Leader>w` saves.
 - `<Leader>q` closes files.
-- `<Leader>l` lists loaded buffers and lets you jump to them by number.
+- `<Leader>l` lists loaded buffers and allows jumping to them by number.
 - `<Leader>p` fuzzy-finds files.
 - `<Leader>f` fuzzy-finds functions in the current file.
 - `<Leader>t` opens a function/variable list for the current file.
@@ -70,7 +70,7 @@ Below is a non-exhaustive list of dotfiles usage.
 - Additional text objects exist (see `'Text Objects'` in [plugins.vim][]).
 - Saving `.pandoc` files also outputs `.docx` versions.
 - `:Goyo` for distraction-free writing.
-- `:Dark`, `:Light` and `:Neon` colour schemes available.
+- `:Alduin`, `:Dark`, `:Light` and `:Neon` colour schemes available.
 
 [plugins.vim]: vim/plugins.vim
 

+ 1 - 0
vim/plugins.vim

@@ -31,6 +31,7 @@ Plug 'vim-scripts/visualrepeat'
 " }}}
 
 " Visual {{{
+Plug 'AlessandroYorba/Alduin'
 Plug 'Sclarki/airline-surarken'
 Plug 'Sclarki/neonwave.vim'
 Plug 'altercation/vim-colors-solarized'

+ 0 - 3
vim/settings/camelcasemotion.vim

@@ -1,3 +0,0 @@
-map <silent> ,w <Plug>CamelCaseMotion_w
-map <silent> ,b <Plug>CamelCaseMotion_b
-map <silent> ,e <Plug>CamelCaseMotion_e

+ 9 - 4
vim/settings/colorscheme-statusline.vim

@@ -20,6 +20,11 @@ let g:airline#extensions#wordcount#filetypes = '\vhelp|markdown|rst|org|pandoc'
 set noshowmode   " hide modes e.g. --INSERT-- with themed status lines.
 
 " Toggle colour schemes.
+command! Alduin let g:alduin_Contract_Vampirism = 1
+      \| colorscheme alduin
+      \| call StatusTheme('ubaryd')
+      \| call writefile(['Alduin'], g:current_colour)
+
 command! Dark set background=dark
       \| colorscheme solarized
       \| call StatusTheme('powerlineish')
@@ -37,11 +42,11 @@ command! Neon set background=light
       \| call writefile(['Neon'], g:current_colour)
 
 " Toggle Solarized Colour Palette Degradation.
-command! SolarizedColourPalette execute 'silent !touch' g:solarized_palette
+command! SolarizedColourProper execute 'silent !touch' g:solarized_palette
       \| let g:solarized_termcolors=16
       \| execute 'source' g:current_colour
 
-command! SolarizedColourDegrade execute 'silent !rm' g:solarized_palette
+command! SolarizedColourDegraded execute 'silent !rm' g:solarized_palette
       \| let g:solarized_termcolors=256
       \| execute 'source' g:current_colour
 
@@ -70,9 +75,9 @@ if !filereadable(g:solarized_palette)
   let g:solarized_termcolors=256
 endif
 
-" Use the last chosen colour scheme or default to Dark.
+" Use the last chosen colour scheme or default to a dark colorscheme.
 if filereadable(expand(g:current_colour))
   execute 'source' g:current_colour
 else
-  Dark
+  Alduin
 endif

+ 2 - 1
vim/settings/commenting.vim

@@ -1,6 +1,7 @@
-" Toggle Commenting out lines with NERDCommenter
+" Toggle Commenting out lines with NERDCommenter.
 nnoremap <silent> cc :call NERDComment("n", "toggle")<CR>
 vnoremap <silent> cc <Esc>:call NERDComment("x", "toggle")<CR>
 
+" Add PHP docblocks.
 let g:pdv_template_dir = expand('~/.vim/plugged/pdv/templates')
 map <Leader>b :call pdv#DocumentCurrentLine()<CR>

+ 5 - 5
vim/settings/filebrowser.vim

@@ -9,18 +9,19 @@ augroup dirvishCustomisation
   " Allow fugitive.vim commands in dirvish buffers.
   autocmd FileType dirvish call fugitive#detect(@%)
 
-  " Use 'o' to (o)pen and 'i' to spl(i)t.
+  " Add/Adjust mappings.
+  " - Reverse 'o' to (o)pen and 'i' to spl(i)t.
+  " - `mc` to create a file.
   autocmd FileType dirvish let s:nowait = (v:version > 703 ? '<nowait>' : '')
         \| execute 'nnoremap '.s:nowait.'<buffer><silent> o :<C-U>.call dirvish#open("edit", 0)<CR>'
         \| execute 'nnoremap '.s:nowait.'<buffer><silent> i :<C-U>.call dirvish#open("split", 1)<CR>'
         \| execute 'xnoremap '.s:nowait.'<buffer><silent> O :call dirvish#open("edit", 0)<CR>'
         \| execute 'xnoremap '.s:nowait.'<buffer><silent> I :call dirvish#open("split", 1)<CR>'
+        \| execute 'nnoremap '.s:nowait.'<buffer> mc :e %'
 augroup END
 
 " CtrlP - Fuzzy Finder in Vimscript
 
-"let g:ctrlp_map = '<Leader>p'
-
 " Use `ag` as fallback if available.
 if executable('ag')
   let s:fallback = 'ag %s -l --nocolor -g ""'
@@ -34,9 +35,8 @@ let g:ctrlp_user_command = [
   \ s:fallback
 \]
 
-let g:ctrlp_extensions = ['funky']
-
 " Function definition jumping with CtrlP's Funky plugin.
+let g:ctrlp_extensions = ['funky']
 map <silent> <Leader>f :CtrlPFunky<CR>
 
 

+ 0 - 6
vim/settings/filetype-specifics.vim

@@ -7,12 +7,6 @@ au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/plugged/yaml.vim/colors/yaml.vim
 " `.conf` and `.ini` files should not force text to the next line.
 au BufEnter *.conf,*.ini setlocal textwidth=0
 
-" Load coffee script plugin for literate coffeescript files as well
-autocmd FileType litcoffee runtime ftplugin/coffee.vim
-" Compile and Watch should open vertical splits by default
-let coffee_compile_vert = 1
-let coffee_watch_vert = 1
-
 " RiotJS Tag support
 au BufNewFile,BufRead *.tag setlocal ft=javascript
 

+ 1 - 5
vim/settings/search.vim

@@ -8,13 +8,9 @@ elseif executable('ack-grep')
   set grepprg=ack-grep\ --with-filename\ --nocolor\ --nogroup\ --column
 endif
 
-" don't display ack/grep terminal output. NOTE: not reliable
-" https://github.com/mileszs/ack.vim/issues/18
-"set shellpipe=&>
-
 " EasyGrep settings.
 let g:EasyGrepCommand = 1            " Default to grepprg instead of vimgrep.
 let g:EasyGrepRecursive = 1
-let g:EasyGrepReplaceWindowMode = 2  " `Replace` in same window, not tabs/splits
+let g:EasyGrepReplaceWindowMode = 2  " Replace in same window, not tabs/splits
 let g:EasyGrepFilesToExclude=".git"  " Exclude dirs for `ack` and `grep`
 let g:EasyGrepRoot = "search:.git,.hg,.svn"  " Repo-aware when possible.

+ 2 - 0
vim/settings/textobjects.vim

@@ -0,0 +1,2 @@
+" Use ',' instead of '<leader>' for camel/snake case
+execute camelcasemotion#CreateMotionMappings(',')

+ 2 - 3
vim/settings/toggles.vim

@@ -1,7 +1,6 @@
 " Toggle Undotree
 nnoremap <silent> <Leader>u :UndotreeToggle<CR>
 
-" Toggle Tagabar
+" Toggle Tagbar
 nnoremap <silent> <Leader>t :TagbarToggle<CR>
-" Close tagbar after we go to selection
-let g:tagbar_autoclose = 1
+let g:tagbar_autoclose = 1  " Close Tagbar after selection