/
vimrc.local
83 lines (70 loc) · 2.5 KB
/
vimrc.local
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"" file: ~/.vimrc.local
set backupdir=~/.tmp
let os = substitute(system('uname'),"\n","","")
if os == "Darwin"
noremap <leader>ct :!/opt/boxen/homebrew/bin/ctags -R --exclude=\*.js --exclude=vendor/\* .<CR>
noremap <leader>, <Esc>:w<CR>:!/opt/boxen/rbenv/shims/ruby %<CR>
elseif os == "Linux"
noremap <leader>ct :!/usr/bin/ctags -R --exclude=\*.js --exclude=vendor/\* .<CR>
noremap <leader>, <Esc>:w<CR>:!$HOME/.rbenv/shims/ruby %<CR>
"" If you are working on Clojure
"noremap <leader>c <Esc>:w<CR>:!cljsc %<CR>
"noremap <leader>r <Esc>:w<CR>:r !cljsc %<CR>
endif
"" From: https://github.com/zenazn/dotfiles/blob/master/vimrc {{{
"" Trailing whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
au ColorScheme * highlight ExtraWhitespace guibg=red
au BufEnter * match ExtraWhitespace /\s\+$/
"" Remove them if you are in the good team at work!
"au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
"au InsertLeave * match ExtraWhiteSpace /\s\+$/
"" }}}
"" Add some runtimepath to make 'gf' work better with current project
set runtimepath+=.
set runtimepath+=../widget
set runtimepath+=app
set runtimepath+=app/widget
set runtimepath+=node_modules
set suffixesadd+=.coffee
set suffixesadd+=.json
set number
set nowrap
"" Save the content of the last match e.g. :g// into the register @a
"" See: http://goo.gl/VKdFvg
nnoremap <silent> <F3> :redir @a<CR>:g//<CR>:redir END<CR>:new<CR>:put! a<CR>
"" Experimental mappings
"" See: http://stackoverflow.com/questions/916875/yank-file-name-path-of-current-buffer-in-vim
nmap cp :let @+ = expand("%")<CR>
"colorscheme apprentice
"colorscheme darkblue
"colorscheme doom-one
"colorscheme iceberg
"colorscheme seoul256
"colorscheme seoul256-light
"colorscheme tibet
"" For screenshot?
"colorscheme Tomorrow
"colorscheme xoria256
"" Suppress the startup message
set shortmess+=I
set wrapscan
"" Make whitespace visible so we can see if tabs, are being used
"" See: http://vimcasts.org/episodes/show-invisibles/
"" entered by :ctrl-vu followed by the 4 digit hexadecimal code
"set list
"set listchars=eol:¬,tab:>-,trail:~,extends:>,precedes:<
"" Copy from clipboard quicker
"nnoremap <F2> :set invpaste paste?<CR>
"set pastetoggle=<F2>
"set showmode
"" The same but without using F2
"" https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction