-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
104 lines (89 loc) · 2.72 KB
/
Copy pathinit.vim
File metadata and controls
104 lines (89 loc) · 2.72 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
call plug#begin()
" A Vim plugin which shows a git diff in the 'gutter' (sign column).
Plug 'airblade/vim-gitgutter'
" Color scheme
Plug 'ayu-theme/ayu-vim'
" Syntax highlighting for .toml
Plug 'cespare/vim-toml'
" Full path fuzzy file
Plug 'ctrlpvim/ctrlp.vim'
" scrooloose/nerdcommenter ???
" Toggle code to comment
Plug 'ddollar/nerdcommenter'
" A light and configurable statusline/tabline plugin for Vim
Plug 'itchyny/lightline.vim'
" provides ALE indicator for the lightline vim plugin
Plug 'maximbaz/lightline-ale'
" Wrapper for prettier
Plug 'prettier/vim-prettier', { 'do': 'yarn install', 'for': ['javascript', 'typescript', 'css', 'json', 'graphql', 'yaml', 'html'] }
" Wrapper for git
Plug 'tpope/vim-fugitive'
" Modify 'surrounding' pairs
Plug 'tpope/vim-surround'
" Asynchronous linting/fixing
Plug 'w0rp/ale'
Plug 'ervandew/supertab'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-endwise'
call plug#end()
let g:ale_fixers = {
\ 'javascript': [
\ 'eslint',
\ 'prettier'
\ ],
\ 'python': ['autopep8', 'isort'],
\ 'ruby': ['rubocop'],
\ 'rust': ['rustfmt']
\}
let g:ale_completion_enabled = 1
let g:lightline = {
\ 'component_function': {
\ 'filename': 'LightlineFilename',
\ }
\ }
let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ }
let g:lightline.component_type = {
\ 'linter_checking': 'left',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'left',
\ }
let g:lightline.active = { 'right': [[ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok' ]] }
function! LightlineFilename()
let root = fnamemodify(get(b:, 'git_dir'), ':h')
let path = expand('%:p')
if path[:len(root)-1] ==# root
return path[len(root)+1:]
endif
return expand('%')
endfunction
set termguicolors " enable true colors support
let ayucolor="dark" " for dark version of theme
colorscheme ayu
set colorcolumn=80
set number
set cursorline
set nowrap
set noshowmode
" After whitespace, insert the current directory into a command-line path
cnoremap <expr> <C-P> getcmdline()[getcmdpos()-2] ==# ' ' ? expand('%:p:h') : "\<C-P>"
inoremap <C-j> <Esc>:m .+1<CR>==gi
inoremap <C-k> <Esc>:m .-2<CR>==gi
map <leader>/ <plug>NERDCommenterToggle<CR>
map <leader>f :ALEFix<CR>
map <leader>p :Prettier<CR>
nmap ; :
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
nmap du dt_
nmap cu ct_
set expandtab shiftwidth=2 softtabstop=2 smarttab