-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
143 lines (121 loc) · 4.65 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
set nocompatible
syntax on
" Use Ctrl + [h,j,k,l] to move window focus
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" The NERDTree
map <C-n> :NERDTreeToggle<CR>
let NERDTreeShowHidden=1
" test.vim
nnoremap <Leader>tn :TestNearest<CR>
nnoremap <Leader>tf :TestFile<CR>
nnoremap <Leader>ts :TestSuite<CR>
nnoremap <Leader>tl :TestLast<CR>
nnoremap <Leader>tg :TestVisit<CR>
" vim-mix-format
let g:mix_format_on_save = 1
let g:elm_format_on_save = 1
" Disable swap files
set noswapfile
" Nicer colors for status and command line
set laststatus=2
" More readable command line mode completion
set wildmenu
" UI
set number " line numbers
set ruler " show the cursor position
set showcmd " show command at bottom
set showmatch " highlight matching [{()}]
set clipboard=unnamedplus " share clipboard and work with ctrl+v and ctrl+c
set history=1000
set tabstop=4 " spaces per tab
set shiftwidth=4 " shifts left or right by four spaces
set softtabstop=4 " tab while typing
set scrolloff=4 " scroll offset
set spell
" autocmd FileType markdown,text,gitcommit setlocal spell
set backspace=indent,eol,start " can backspace in insert mode
set mouse=a " can scroll with mouse
set expandtab " converts tabs to spaces
set wrap " enable line wrapping
set undofile " enable persistent undo
set ai " autoindent
set si " smart indent"
" Split window behavior
set splitright " Vertical splits will automatically go to the right
set splitbelow " Horizontal splits will automatically go below
" Enable folding
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
" Better search
set hlsearch
set incsearch
set ignorecase
set smartcase "type all lowercase = case-insensitive; type one+ words uppercase = case-sensitive
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'avakhov/vim-yaml' " Yaml syntax
Plugin 'bronson/vim-trailing-whitespace' " Hightlight trailing whitespace
Plugin 'kien/rainbow_parentheses.vim' " Parenthesis highlighting
Plugin 'MarcWeber/vim-addon-mw-utils' " Interprets file by extension
Plugin 'tpope/vim-surround' " Better parenthesis support
Plugin 'itchyny/lightline.vim' " Better status line
Plugin '[email protected]:itchyny/vim-gitbranch.git' " Git Branch display
Plugin 'elmcast/elm-vim' " Elm plugin
Plugin 'elixir-lang/vim-elixir' " Elixir plugin
Plugin 'elzr/vim-json' " Json
Plugin 'w0rp/ale' " Linting engine
Plugin 'pangloss/vim-javascript' " Javascript
Plugin 'othree/yajs.vim' " javascript syntax
Plugin 'mxw/vim-jsx' " JSX highlighting
Plugin 'eagletmt/ghcmod-vim'
Plugin 'Shougo/vimproc'
Plugin 'rust-lang/rust.vim' " Rust plugin
Plugin 'preservim/nerdtree' " The NERDTree
Plugin 'tomlion/vim-solidity' " Solidity syntax
Plugin 'leafgarland/typescript-vim' " Typescript syntax
Plugin 'mileszs/ack.vim' " ack.vim (brew install ack the_silver_searcher)
Plugin 'tmhedberg/SimpylFold'
Plugin 'ycm-core/YouCompleteMe'
Plugin 'fisadev/vim-isort' " call :Isort command and will reorder imports of current python file
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
au FileType json setl sw=2 sts=2 et " Indentation for json
" Git Branch/Lightline
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'gitbranch#name'
\ },
\ }
" ================================================ ale lint ==========================================
let g:ale_linters = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['flake8'],
\ 'javascript': ['eslint'],
\ 'typescript': ['tsserver', 'tslint'],
\ 'vue': ['eslint']
\}
let g:ale_fixers = {
\ 'python': ['black', 'isort'],
\ 'javascript': ['eslint'],
\ 'typescript': ['prettier'],
\ 'vue': ['eslint'],
\ 'scss': ['prettier'],
\ 'html': ['prettier']
\}
let g:ale_fix_on_save = 1
" Changes cursors depending on mode
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_SR = "\<Esc>]50;CursorShape=2\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"