Merge pull request #14 from kylewest/vim-tweaks
Key bindings for wrapping, etc
This commit is contained in:
@@ -369,6 +369,10 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
* `Cmd-/` - toggle comments (usually gcc from tComment)
|
||||
* `gcp` (comment a paragraph)
|
||||
|
||||
**Wrapping**
|
||||
|
||||
* :Wrap - wrap long lines (e.g. when editing markdown files).
|
||||
* Cmd-[j, k, $, 0, ^] - navigate display lines.
|
||||
|
||||
### Included vim plugins
|
||||
|
||||
@@ -450,6 +454,11 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
* sass-status - decorates your status bar with full nesting of where you are in the sass file
|
||||
|
||||
|
||||
### Overriding vim settings
|
||||
|
||||
You may use `~/.vimrc.before` for settings like the __leader__ setting. You may `~/.vimrc.after` for any additional overrides/settings.
|
||||
|
||||
|
||||
### Adding your own vim plugins
|
||||
|
||||
YADR comes with a dead simple plugin manager that just uses git submodules, without any fancy config files.
|
||||
|
||||
10
vim/after/plugin/vimrc_after.vim
Normal file
10
vim/after/plugin/vimrc_after.vim
Normal file
@@ -0,0 +1,10 @@
|
||||
" https://github.com/carlhuda/janus/blob/master/janus/vim/core/janus/after/plugin/vimrc_after.vim
|
||||
" Customization
|
||||
"
|
||||
" This loads after the janus plugins so that janus-specific plugin mappings can
|
||||
" be overwritten.
|
||||
|
||||
if filereadable(expand("~/.vimrc.after"))
|
||||
source ~/.vimrc.after
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
This directory contains settings for various vim plugins and vim itself.
|
||||
|
||||
For cleanliness, each plugin's overrides/settings should be put into a
|
||||
separate file.
|
||||
## Plugin Settings
|
||||
|
||||
Each plugin's overrides/settings should be put in a separate file named `{plugin-name}.vim`.
|
||||
|
||||
## Vim Settings
|
||||
|
||||
General vim overrides/settings should be put in a separate file named `yadr-{descriptive-name}.vim`.
|
||||
|
||||
@@ -129,7 +129,6 @@ map <silent> <D-6> :tabn 6<cr>
|
||||
map <silent> <D-7> :tabn 7<cr>
|
||||
map <silent> <D-8> :tabn 8<cr>
|
||||
map <silent> <D-9> :tabn 9<cr>
|
||||
map <silent> <D-0> :tabn 0<cr>
|
||||
|
||||
" Create window splits easier. The default
|
||||
" way is Ctrl-w,v and Ctrl-w,s. I remap
|
||||
@@ -137,7 +136,6 @@ map <silent> <D-0> :tabn 0<cr>
|
||||
nnoremap <silent> vv <C-w>v
|
||||
nnoremap <silent> ss <C-w>s
|
||||
|
||||
|
||||
"open the taglist (method browser) using ,t
|
||||
nnoremap <silent> ,T :TlistToggle<CR>
|
||||
|
||||
20
vim/plugin/settings/yadr-wrapping.vim
Normal file
20
vim/plugin/settings/yadr-wrapping.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" http://vimcasts.org/episodes/soft-wrapping-text/
|
||||
function! SetupWrapping()
|
||||
set wrap linebreak nolist
|
||||
set showbreak=…
|
||||
endfunction
|
||||
|
||||
" TODO: this should happen automatically for certain file types (e.g. markdown)
|
||||
command! -nargs=* Wrap :call SetupWrapping()<CR>
|
||||
|
||||
vmap <D-j> gj
|
||||
vmap <D-k> gk
|
||||
vmap <D-$> g$
|
||||
vmap <D-^> g^
|
||||
vmap <D-0> g^
|
||||
nmap <D-j> gj
|
||||
nmap <D-k> gk
|
||||
nmap <D-$> g$
|
||||
nmap <D-^> g^
|
||||
nmap <D-0> g^
|
||||
|
||||
7
vimrc
7
vimrc
@@ -2,6 +2,12 @@
|
||||
" This must be first, because it changes other options as a side effect.
|
||||
set nocompatible
|
||||
|
||||
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>.
|
||||
" source ~/.vimrc.before if it exists.
|
||||
if filereadable(expand("~/.vimrc.before"))
|
||||
source ~/.vimrc.before
|
||||
endif
|
||||
|
||||
" =============== Pathogen Initialization ===============
|
||||
" This loads all the plugins in ~/.vim/bundle
|
||||
" Use tpope's pathogen plugin to manage all other plugins
|
||||
@@ -90,3 +96,4 @@ set wildignore+=*vim/backups*
|
||||
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
|
||||
set sidescrolloff=15
|
||||
set sidescroll=1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user