-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
133 lines (111 loc) · 3.22 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
syntax on
let mapleader = ","
filetype indent on
set backspace=2 " Backspace deletes like most programs in insert mode
set clipboard=unnamed
set cursorline
set expandtab
set hidden
set history=50
set incsearch
set laststatus=2 " Always display the status line
set list listchars=tab:»·,trail:·,nbsp:·
set noswapfile
set number
set numberwidth=5
set ruler " show the cursor position all the time
set shiftround
set shiftwidth=2
set showcmd " display incomplete commands
set splitbelow
set splitright
set tabstop=2
set textwidth=80
set re=2 " regex engine
let g:pyindent_searchpair_timeout = 10
inoremap <Nul> <C-n>
map! <C-q> <ESC>
nnoremap <Leader><Leader> <C-^>
nnoremap <Leader>. :bnext<CR>
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
noremap <Leader>w :update<CR>
"test shortcuts
nmap <silent> t<C-n> :TestNearest<CR>
nmap <silent> t<C-f> :TestFile<CR>
nmap <silent> t<C-s> :TestSuite<CR>
nmap <silent> t<C-l> :TestLast<CR>
nmap <silent> t<C-g> :TestVisit<CR>
"fzf
noremap <C-p> :Files<CR>
noremap <Leader><C-p> :Buf<CR>
" Colors
hi ColorColumn ctermbg=8
hi Visual ctermbg=8
hi htmlBold ctermbg=8
hi LineNr ctermfg=8
hi SpecialKey ctermfg=8
"Plugins
call plug#begin('~/.vim/bundle')
" Define bundles via Github repos
Plug 'embark-theme/vim', { 'as': 'embark', 'branch': 'main' }
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'derekprior/vim-trimmer'
Plug 'elixir-lang/vim-elixir'
Plug 'elmcast/elm-vim'
Plug 'eslint/eslint'
Plug 'fatih/vim-go'
Plug 'janko-m/vim-test'
Plug 'mattn/emmet-vim'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'evanleck/vim-svelte'
Plug 'isruslan/vim-es6'
Plug 'etdev/vim-hexcolor'
Plug 'editorconfig/editorconfig-vim'
Plug 'w0rp/ale'
" post install (yarn install | npm install) then load plugin only for editing supported files
Plug 'prettier/vim-prettier', {
\ 'do': 'yarn install',
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }
Plug 'sophacles/vim-processing'
Plug 'tidalcycles/vim-tidal'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
call plug#end()
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
if executable('ag')
" Use Ag over Grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag --literal --files-with-matches --nocolor --hidden -g "" %s'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
if !exists(":Ag")
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag -Q '
endif
endif
noremap <leader>a :Ag -Q <C-R><C-W><CR>
let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.2"}
" ALE colors
highlight ALEWarning ctermbg=8
highlight ALEError ctermbg=8
"
let g:ale_linters_explicit = 1
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
if !has('gui_running') && &term =~ '^\%(screen\|tmux\)'
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
syntax on
set termguicolors
colorscheme embark