-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
173 lines (139 loc) · 4.67 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
set nocompatible
call plug#begin('~/.vim/bundle')
Plug 'elixir-lang/vim-elixir'
Plug 'flowtype/vim-flow'
Plug 'gcmt/wildfire.vim'
Plug 'itchyny/lightline.vim'
Plug 'pangloss/vim-javascript'
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'keith/swift.vim'
Plug 'moll/vim-node'
Plug 'mxw/vim-jsx'
Plug 'nanotech/jellybeans.vim', { 'tag': 'v1.6' }
Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' }
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'vim-scripts/tComment'
" <Tab> indents or triggers autocomplete, smartly
Plug 'ervandew/supertab'
Plug 'scrooloose/nerdtree'
Plug 'raichoo/purescript-vim'
Plug 'jparise/vim-graphql'
Plug 'mustache/vim-mustache-handlebars'
Plug 'alx741/stylish-haskell'
Plug 'tomlion/vim-solidity'
Plug 'tpope/vim-liquid'
Plug 'leafgarland/typescript-vim'
Plug 'tpope/vim-repeat'
call plug#end()
let g:lightline = {
\ 'colorscheme': 'jellybeans',
\ 'mode_map': { 'c': 'NORMAL' },
\ 'component': {
\ 'readonly': '%{&readonly?"⭤":""}',
\ },
\ 'inactive': {
\ 'left': [['filename'], ['modified']],
\ 'right': [['lineinfo'], ['percent']]
\ }
\ }
set guifont=Inconsolata
syntax enable
filetype plugin indent on
set background=dark
colorscheme jellybeans
let mapleader = " "
"Case-insensitive searching.
set ignorecase
" But case-sensitive if expression contains a capital letter.
set smartcase
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile
set showcmd " display incomplete commands
set showmode
set history=50
set incsearch " do incremental searching
set ruler " show the cursor position all the time
set laststatus=2 " Always display the status line
set autowrite
set scrolloff=1 " When scrolling, keep cursor in the middle
set shiftround " When at 3 spaces and I hit >>, go to 4, not 5.
set ttimeoutlen=50 " Lower the key sequence delay.
set nojoinspaces " Only use one space after sentences
" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set expandtab
" Display extra whitespace
set list listchars=tab:»·,trail:·,nbsp:·
" Make it obvious where 80 characters is
set textwidth=80
set colorcolumn=+1
" Numbers
set relativenumber " Use relative line numbers
set number
set numberwidth=5
" Open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
" Mnemonic: vgf = "vsplit gf"
nnoremap vgf :vsplit<CR>gf<CR>
" Mnemonic: sgf = "split gf"
nnoremap sgf :split<CR>gf<CR>
" Persistent undo
set undofile " Create FILE.un~ files for persistent undo
set undodir=~/.vim/undodir
" Use the system pasteboard
set clipboard=unnamed
" Quicker window movement
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Autocomplete with dictionary words when spell check is on
set complete+=kspell
" Always use vertical diffs
set diffopt+=vertical
augroup vimrcEx
autocmd!
" When editing a file, always jump to the last known cursor position.
" Don't do it for commit messages, when the position is invalid, or when
" inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" Set syntax highlighting for specific file types
autocmd BufRead,BufNewFile Gemfile set filetype=ruby
autocmd BufRead,BufNewFile *.md set filetype=markdown
autocmd BufNewFile,BufRead Podfile,*.podspec set filetype=ruby
autocmd BufNewFile,BufRead *liftoffrc set filetype=yaml
autocmd BufNewFile,BufRead PULLREQ_EDITMSG set filetype=gitcommit
autocmd BufRead,BufNewFile Fastfile set filetype=ruby
" Enable spellchecking for Markdown
autocmd FileType markdown setlocal spell
" Automatically wrap at 80 characters for Markdown
autocmd BufRead,BufNewFile *.md setlocal textwidth=80
" Automatically wrap at 72 characters and spell check git commit messages
autocmd FileType gitcommit setlocal textwidth=72
autocmd FileType gitcommit setlocal spell
" Allow stylesheets to autocomplete hyphenated words
autocmd FileType css,scss,sass setlocal iskeyword+=-
" Turn off line wrapping for liquid, css, sass, and html files
autocmd FileType liquid,css,scss,sass,html setlocal textwidth=0
augroup END
" Fuzzy find files with fzf
nnoremap <leader>f :Files<CR>
" no ex mode
map Q <Nop>
" Automatically reselect text after in- or out-denting in visual mode
xnoremap < <gv
xnoremap > >gv
let g:flow#autoclose = 1
map <Leader>n :NERDTreeToggle<CR>
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1