-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
103 lines (86 loc) · 3.37 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
" Use the space key as our leader. Put this near the top of your vimrc
let mapleader = "\<Space>"
" go to first character of line
nmap 0 ^
" Split edit your vimrc. Type space, v, r in sequence to trigger
nmap <leader>vr :sp $MYVIMRC<cr>
" Source (reload) your vimrc. Type space, s, o in sequence to trigger
nmap <leader>so :source $MYVIMRC<cr>
set number " Display line numbers beside buffer
set nocompatible " Don't maintain compatibilty with Vi.
set hidden " Allow buffer change w/o saving
set lazyredraw " Don't update while executing macros
set backspace=indent,eol,start " Sane backspace behavior
set history=1000 " Remember last 1000 commands
set scrolloff=4 " Keep at least 4 lines below cursor
" Make CtrlP use ag for listing the files. Way faster and no useless files.
let g:ctrlp_user_command = 'ag %s -l --hidden --nocolor -g ""'
let g:ctrlp_use_caching = 1
let g:ctrlp_working_path_mode = 'ra'
" RSpec.vim mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
" Run rspecs with Dispatch
let g:rspec_command = "Dispatch rspec {spec}"
" Ignore backups and swap files
set nobackup
set nowritebackup
set noswapfile
set history=50
"Credit joshdick
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
let g:one_allow_italics = 1
let g:airline_theme='nord'
syntax on
filetype plugin indent on
set guifont=DroidSansMono\ Nerd\ Font:h11
let g:terraform_align=1
let g:terraform_fmt_on_save = 1
" SEE: https://coderwall.com/p/nckasg/map-w-to-w-in-vim
:command WQ wq
:command Wq wq
:command W w
:command Q q
autocmd BufRead,BufNewFile * setlocal spell
autocmd FileType gitcommit setlocal spell
set complete+=kspell
" Auto install vim-plug
" SEE: https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'arcticicestudio/nord-vim', { 'as': 'nord' }
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-dispatch'
Plug 'thoughtbot/vim-rspec'
Plug 'editorconfig/editorconfig-vim'
Plug 'hashivim/vim-terraform'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'vim-scripts/fish-syntax'
Plug 'mtth/scratch.vim'
Plug 'fatih/vim-go'
call plug#end()
colorscheme nord