-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
139 lines (112 loc) · 3.27 KB
/
vimrc
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
" Required by vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Required by vundle
Bundle 'gmarik/vundle'
" Custom bundle list
Bundle "mileszs/ack.vim"
Bundle "jlanzarotta/bufexplorer"
Bundle "ctrlpvim/ctrlp.vim"
" Bundle "cucumber.zip"
Bundle "endwise.vim"
Bundle "fugitive.vim"
Bundle "tpope/vim-haml"
Bundle "othree/html5.vim"
Bundle "The-NERD-tree"
Bundle "tpope/vim-rails"
Bundle "surround.vim"
Bundle "scrooloose/syntastic"
" Bundle "tpope/vim-bundler"
Bundle "vim-coffee-script"
Bundle 'pangloss/vim-javascript'
Bundle 'mxw/vim-jsx'
Bundle "itspriddle/vim-jquery"
" Bundle "hallison/vim-ruby-sinatra"
Bundle "vim-ruby/vim-ruby"
" Bundle "tpope/vim-rvm"
Bundle "jpo/vim-railscasts-theme"
Bundle "ap/vim-css-color"
Bundle "ruanyl/vim-gh-line"
Bundle "pechorin/any-jump.vim"
" End of bundle list
filetype plugin indent on
" Custom config
set history=1000 " longer history
set showcmd " show incomplete cmds down the bottom
set showmode " show current mode down the bottom
set incsearch " find the next match as we type the search
set hlsearch " highlight searches
set relativenumber " add relative line numbers - SLOW
set cursorline " underline current (cursor) line - SLOW
set ruler " show row/col at the bottom right
set nowrap " no wrapping
set colorcolumn=80 " but show a line at 80 chars
" optimization settings to alleviate sluginess
set re=1 " older regex engine is faster for Ruby regexes
set lazyredraw
"indent settings
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set autoindent
"status line
set statusline=%f
set statusline+=%{fugitive#statusline()}
set statusline+=%{exists('g:loaded_rvm')?rvm#statusline():''}
set statusline+=%= "left/right separator
set statusline+=%c,
set statusline+=%l/%L
set statusline+=\ %P
"remove GUI toolbar
set guioptions-=T
syntax on
let NERDTreeMinimalUI=1
colorscheme railscasts
set mouse=a
"keyboard
let mapleader = ","
nnoremap <leader>b :BufExplorer<cr>
nnoremap <leader>p :CtrlPMixed<cr>
nnoremap <leader>a :Ack! --word-regexp <cword><cr>
silent! nmap <silent> <leader>t :NERDTreeToggle<cr>
"command aliases for when I keep shift down a bit too long after the colon
command W w
command Q q
"replace ack with ag
if executable('rg')
let g:ackprg = 'rg --vimgrep'
endif
"fixes background color erase issue: https://sw.kovidgoyal.net/kitty/faq.html#id3
if $TERM == 'xterm-kitty'
let &t_ut=''
endif
"greek keymap, CTRL+6 to switch
set keymap=greek_utf-8
set iminsert=0
set imsearch=-1
" Current filename in title
set title
" ctrlP plugin config
let g:ctrlp_root_markers = ['docker-compose.yml', 'Gemfile']
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" vim-gh-line config
let g:gh_use_canonical = 1
let g:gh_open_command = 'xdg-open '
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
" Svelte as html
au! BufNewFile,BufRead *.svelte set ft=html