-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.local
More file actions
143 lines (112 loc) · 4.33 KB
/
vimrc.local
File metadata and controls
143 lines (112 loc) · 4.33 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
set nocompatible " be iMproved
filetype off " required!
" Kill Beeps
set noeb vb t_vb=
" recommended configurations for powerline
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show Unicode glyphs
let g:Powerline_symbols = 'fancy'
" Turn on auto-indenting and set it to copy previous
" indentation
set autoindent
set copyindent
" testing strategy for vim-test
" let test#strategy = "tslime"
" let test#strategy = "vimterminal"
let test#strategy = "vimux"
let g:tslime_always_current_session = 1
let g:tslime_always_current_window = 1
" Highlight matching parentheses
set showmatch
syntax enable
set background=dark
colorscheme jellybeans
" Resize windows with arrow keys
nnoremap <D-Up> <C-w>+
nnoremap <D-Down> <C-w>-
nnoremap <D-Left> <C-w><
nnoremap <D-Right> <C-w>>
" hit ,f to find the definition of the current class
" this uses ctags. the standard way to get this is Ctrl-]
nnoremap <silent> ,f <C-]>
" use ,F to jump to tag in a vertical split
nnoremap <silent> ,F :let word=expand("<cword>")<CR>:vsp<CR>:wincmd w<cr>:exec("tag ". word)<cr>
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
autocmd BufNewFile,BufRead DockerQA set filetype=dockerfile
autocmd BufNewFile,BufRead DockerTest set filetype=dockerfile
autocmd BufNewFile,BufRead DockerQA-B set filetype=dockerfile
autocmd BufNewFile,BufRead HistoricalSyncDockerfile set filetype=dockerfile
autocmd BufRead,BufNewFile *.ex,*.exs set filetype=elixir
autocmd BufRead,BufNewFile *.eex,*.heex,*.leex,*.sface,*.lexs set filetype=eelixir
autocmd BufRead,BufNewFile mix.lock set filetype=elixir
autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart
autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear
" Remove trailing white spaces on save.
autocmd BufWritePre * :%s/\s\+$//e
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
set number " Show current line number
set relativenumber " Show relative line numbers
" allow dot command to operate over a visual selection
xnoremap . :normal .<CR>
" allow user macro over a visual selection
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
function! ExecuteMacroOverVisualRange()
echo "@".getcmdline()
execute ":'<,'>normal @".nr2char(getchar())
endfunction
map <Leader>p :set paste<CR>o<esc>"*]p:set nopaste<cr>
map <Leader>i mmgg=G`m
map <Leader>bb :!bundle install<cr>
vmap <Leader>b :<C-U>!git blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR>
map <Leader>gw :!git add . && git commit -m 'WIP' && git push<cr>
map <Leader>d :vs ~/code/Notes/todo.md<cr>
nmap <leader>f orequire IEx; IEx.pry<esc>
set hlsearch
set ignorecase
set smartcase
map <Leader>h :nohlsearch<cr>
let g:jsx_ext_required = 0
let g:python3_host_prog = '/usr/bin/python3'
" vim elixir formatter
let g:mix_format_on_save = 1
let g:mix_format_silent_errors = 1
let g:mix_format_options = '--check-equivalent'
let g:ale_linters = {
\ 'elixir': ['credo', 'elixir-ls'],
\ 'ruby': ['prettier', 'solargraph'],
\ 'javascript': ['prettier', 'eslint', 'tsserver'],
\ 'typescript': ['prettier', 'eslint', 'tsserver'],
\}
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['prettier'],
\ 'typescript': ['prettier'],
\ 'css': ['prettier'],
\ 'html': ['prettier'],
\ 'ruby': ['prettier'],
\}
let g:ale_elixir_elixir_ls_config = {
\ 'elixirLS': {
\ 'dialyzerEnabled': v:false,
\ },
\}
let g:ale_lint_on_enter = 0
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1
" gist-vim configurations
let g:gist_detect_filetype = 1
let g:gist_open_browser_after_post = 1
" help formatting json
com! FormatJson %!python -m json.tool
" Some tslime mappings
" vmap <Leader>mt <Plug>SendSelectionToTmux
" nmap <Leader>mt <Plug>NormalModeSendToTmux
" DisplayTableSummary plugin
nnoremap <leader>dt :DisplayTableSummary<cr>
nnoremap <leader>xt :call popup_clear()<cr>
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --ignore={\"vendor\*\"\,\"node_modules\*\"}
" Use ag in fzf for listing files. Lightning fast and respects .gitignore
let $FZF_DEFAULT_COMMAND = 'ag --literal --files-with-matches --nocolor --hidden -g "" --ignore={"vendor*","node_modules*"}'
endif