Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 147 lines (122 sloc) 3.472 kB
4741db2 @nelstrom Start building up vimrc again
authored
1 " vim: nowrap fdm=marker
2 source ~/dotfiles/bundles.vim
66ff87d @nelstrom Enable :Man command; use fnameescape() in %% map
authored
3 runtime ftplugin/man.vim
4741db2 @nelstrom Start building up vimrc again
authored
4
5 " Personal preferences not set by sensible.vim
6 set history=5000
7 set showcmd
72a0bb2 @nelstrom set nojoinspaces
authored
8 set nojoinspaces
4741db2 @nelstrom Start building up vimrc again
authored
9 " set listchars=tab:▸\ ,eol:¬
10 set foldlevelstart=99
11 set noswapfile
12 if has('mouse')
13 set mouse=nv
14 endif
15
f4ae8f5 @nelstrom In iterm, use a | cursor in Insert mode
authored
16 let &t_SI = "\<Esc>]50;CursorShape=1\x7"
17 let &t_EI = "\<Esc>]50;CursorShape=0\x7"
18
b019f12 @nelstrom Setup formatexpr to use pandoc on html docs
authored
19 function! FormatprgLocal(filter)
20 if !empty(v:char)
21 return 1
22 else
23 let l:command = v:lnum.','.(v:lnum+v:count-1).'!'.a:filter
24 echo l:command
25 execute l:command
26 endif
27 endfunction
28
29 if has("autocmd")
30 augroup ragtag_filetypes
31 autocmd!
32 autocmd FileType markdown call RagtagInit()
33 augroup END
34 let pandoc_pipeline = "pandoc --from=html --to=markdown"
35 let pandoc_pipeline .= " | pandoc --from=markdown --to=html"
36 autocmd FileType html setlocal formatexpr=FormatprgLocal(pandoc_pipeline)
37 endif
38
4741db2 @nelstrom Start building up vimrc again
authored
39 " Colorscheme
dc6e466 @nelstrom Turn off Q by default. Include prettyprint lib
authored
40 set background=light
ccbdd54 @nelstrom switch to default colorscheme
authored
41 silent! colorscheme default
42
45c2073 @nelstrom set hidden
authored
43 set hidden
4741db2 @nelstrom Start building up vimrc again
authored
44
45 " Plugin configuration {{{1
46 " netrw.vim {{{2
47 let g:netrw_banner=0
dc6e466 @nelstrom Turn off Q by default. Include prettyprint lib
authored
48 " Don't show undo files in the explorer
49 let g:netrw_list_hide='\.un\~$'
4741db2 @nelstrom Start building up vimrc again
authored
50 " Vim-ruby {{{2
24c8439 @nelstrom Turn off folding in ruby, which was interfering with other stuff
authored
51 " let ruby_fold=1
4741db2 @nelstrom Start building up vimrc again
authored
52 " Markdown {{{2
53 let g:markdown_fenced_languages = ['ruby', 'javascript']
448f710 @nelstrom Add a "FIXME" note on markdown weirdness
authored
54 " FIXME:
55 " Markdown files have foldmethod=syntax when both of these options are set:
56 " let ruby_fold=1
57 " let g:markdown_fenced_languages = ['ruby', 'javascript']
58 " to debug, run :verbose set foldmethod?
59 "
4741db2 @nelstrom Start building up vimrc again
authored
60 " Solarized {{{2
61 let g:solarized_menu=0
62 if exists('*togglebg#map')
63 call togglebg#map("<F5>")
64 endif
65 " Ctlr-P {{{2
66 let g:ctrlp_jump_to_buffer = 0
67 let g:ctrlp_working_path_mode = 0
68 let g:ctrlp_user_command = 'find %s -type f'
69 " Ragel {{{2
914a27a @nelstrom Presume .rl is ragel with ruby host
authored
70 augroup ragel
71 autocmd!
72 autocmd BufNewFile,BufRead *.rl setfiletype ragel
73 augroup END
4741db2 @nelstrom Start building up vimrc again
authored
74 let g:ragel_default_subtype='ruby'
75
76 " Mappings {{{1
dc6e466 @nelstrom Turn off Q by default. Include prettyprint lib
authored
77 " Override defaults {{{2
78 nnoremap Q <Nop>
4741db2 @nelstrom Start building up vimrc again
authored
79 " File opening {{{2
66ff87d @nelstrom Enable :Man command; use fnameescape() in %% map
authored
80 cnoremap <expr> %% getcmdtype() == ':' ? fnameescape(expand('%:h')).'/' : '%%'
4741db2 @nelstrom Start building up vimrc again
authored
81
82 map <leader>ew :e %%
83 map <leader>es :sp %%
84 map <leader>ev :vsp %%
85 map <leader>et :tabe %%
86
87 " Prompt to open file with same name, different extension
88 map <leader>er :e <C-R>=expand("%:r")."."<CR>
89
dc6e466 @nelstrom Turn off Q by default. Include prettyprint lib
authored
90
4741db2 @nelstrom Start building up vimrc again
authored
91 " Fix the & command in normal+visual modes {{{2
92 nnoremap & :&&<Enter>
93 xnoremap & :&&<Enter>
94
95 " Strip trailing whitespace {{{2
96 function! Preserve(command)
97 " Preparation: save last search, and cursor position.
98 let _s=@/
99 let l = line(".")
100 let c = col(".")
101 " Do the business:
102 execute a:command
103 " Clean up: restore previous search history, and cursor position
104 let @/=_s
105 call cursor(l, c)
106 endfunction
107
108 nmap _$ :call Preserve("%s/\\s\\+$//e")<CR>
109
110 " Visual line repeat {{{2
111 xnoremap . :normal .<CR>
112 xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
113
114 function! ExecuteMacroOverVisualRange()
115 echo "@".getcmdline()
116 execute ":'<,'>normal @".nr2char(getchar())
117 endfunction
118
119 " Experimental mappings {{{2
120 nnoremap g" /\v<<C-r>"><CR>
c8cb5f2 @nelstrom Add :Path command to inspect Vim's 'path' setting
authored
121
122 command! Path :call EchoPath()
123 function! EchoPath()
124 echo join(split(&path, ","), "\n")
125 endfunction
c448607 @nelstrom Add a :TagFiles command
authored
126
127 command! TagFiles :call EchoTags()
128 function! EchoTags()
129 echo join(split(&tags, ","), "\n")
130 endfunction
f2e1587 @nelstrom Create cp mapping, like xp but works with dot command
authored
131
867e856 @nelstrom Set easyclip to use x as cut, gs as replace
authored
132
133 let g:EasyClipUseSubstituteDefaults = 1
134 nmap <silent> gs <plug>SubstituteOverMotionMap
135 nmap gss <plug>SubstituteLine
136 xmap gs p
137
138 let g:EasyClipUseCutDefaults = 0
139 nmap x <Plug>MoveMotionPlug
140 xmap x <Plug>MoveMotionXPlug
141 nmap xx <Plug>MoveMotionLinePlug
142
f2e1587 @nelstrom Create cp mapping, like xp but works with dot command
authored
143 nmap cp <Plug>TransposeCharacters
144 nnoremap <Plug>TransposeCharacters xp
145 \:call repeat#set("\<Plug>TransposeCharacters")<CR>
146
Something went wrong with that request. Please try again.