-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
145 lines (119 loc) · 3.7 KB
/
init.vim
File metadata and controls
145 lines (119 loc) · 3.7 KB
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
" Basic visual stuff
set number " Show line numbers
set cursorline " Highlight current line
set hlsearch " Highlight matches
set showmatch " Match (){}[]
set list listchars=tab:>\ ,trail:-,eol:$"
" Hardcore mode, disable arrow keys.
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Tabs
set expandtab " Tabs are spaces
set tabstop=2 " Number of visual spaces per tab
set shiftwidth=2
" Advanced / General Stuff
syntax on " Enable Syntax processing
set incsearch " Search as characters are entered
set autochdir " current file is pwd
set backspace=indent,eol,start " makes backspace work
set smartindent autoindent
set undofile " Maintain undo history between sessions
set undodir=~/.vim/undodir
" Folding
set foldenable " enable folding
set foldlevelstart=10 " open most folds by default
set foldnestmax=10 " 10 nested fold max
set foldmethod=indent " fold based on indent level
nnoremap <space> za
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" move to beginning/end of line
nnoremap B ^
nnoremap E $
" $/^ doesn't do anything
nnoremap $ <nop>
nnoremap ^ <nop>
let mapleader=","
" Don't press escape
inoremap jk <esc>
inoremap kj <esc>
noremap ; :
" turn off search highlight ,<space>
nnoremap <leader><space> :nohlsearch<CR>
" edit vimrc/zshrc and load vimrc bindings
nnoremap <leader>ev :vsp $MYVIMRC<CR>
nnoremap <leader>ez :vsp ~/.zshrc<CR>
nnoremap <leader>sv :source $MYVIMRC<CR>
set clipboard=unnamed
" Sessions
au VimLeave * mksession! ~/.vim/sessions/%:t.session
au VimLeave * wviminfo! ~/.vim/sessions/%:t.viminfo
set ssop-=options " do not store global and local values in a session
set ssop-=folds " do not store folds
source /home/miaortizma/.config/nvim/plugins.vim
" Specify a directory for plugins
call plug#begin("~/.config/nvim/plugged")
" Essentials
Plug 'scrooloose/nerdtree'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
" Javascript and Typescript
Plug 'HerringtonDarkholme/yats.vim'
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
" FuzzySearch
Plug '/usr/share/fzf'
Plug 'junegunn/fzf.vim'
" ALE
Plug 'dense-analysis/ale'
" Golang
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Autocomplete with Deoplete
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
let g:deoplete#enable_at_startup = 1
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Initialize plugin system
call plug#end()
filetype plugin indent on
let g:airline_powerline_fonts = 1
let g:airline_theme='gruvbox'
" Gruvbox
set background=light " Setting light mode
set termguicolors
colorscheme gruvbox " Colorscheme
" ALE
let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\ 'typescript': ['prettier', 'tslint'],
\ 'vue': ['eslint'],
\ 'scss': ['prettier'],
\ 'html': ['prettier'],
\ 'reason': ['refmt']
\}
"let g:ale_fix_on_save=true
nnoremap ]r :ALENextWrap<CR> " move to the next ALE warning / error
nnoremap [r :ALEPreviousWrap<CR> " move to the previous ALE warning / error
" FORMATTERS
au FileType javascript setlocal formatprg=prettier
au FileType javascript.jsx setlocal formatprg=prettier
au FileType typescript setlocal formatprg=prettier\ --parser\ typescript
au FileType typescript.tsx setlocal formatprg=prettier\ --parser\ typescript
au FileType html setlocal formatprg=js-beautify\ --type\ html
au FileType scss setlocal formatprg=prettier\ --parser\ css
au FileType css setlocal formatprg=prettier\ --parser\ css
nnoremap <F5> mzgggqG`z
" NERDTreeToggle
nnoremap <leader>n :NERDTreeToggle<CR>
" toggle gundo
nnoremap <leader>u :GundoToggle<CR>