-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim.bak
161 lines (130 loc) · 4 KB
/
init.vim.bak
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
" vim/neovim config used by Nikita Pupko
" Author: Nikita Pupko
" http://github.com/npupko/dotfiles
" General Config {{{
syntax on
set nofoldenable
set visualbell
set relativenumber
set inccommand=nosplit
set nocursorline
set nocursorcolumn
set number
set confirm
set nohidden
set encoding=UTF-8
set clipboard+=unnamedplus
set list listchars=tab:\ \ ,trail:·,eol:¬
set nowrap
" Fuzzy matching
set path+=** " fuzzy matching with :find *.ext*
set wildmenu " Show list instead of just completing
set wildignore+=**/node_modules/** " Ignore some folders
set wildignore+=**/.git/**
set wildignore+=**/build/**
set wildignore+=**/dist/**
set noswapfile
set nobackup
" }}}
" Indentation {{{
set autoindent
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
" let g:ruby_host_prog = 'rvm 2.7.2@global do neovim-ruby-host'
let g:node_host_prog = system('volta which neovim-node-host | tr -d "\n"')
let mapleader = ","
let maplocalleader = " "
lang en_US.UTF-8
lua vim.api.nvim_command([[command! Frt :normal gg O# frozen_string_literal: true<CR><ESC>x ]])
map <leader>cle :call CopyLinterError()<CR>
map <leader>cfp :let @+ = expand("%")<CR>
function! CopyLinterError()
redir @+
1message
redir END
endfunction
map <leader>q :call BufClose()<CR>
function! BufClose()
let bufcount = len(getbufinfo({'buflisted':1}))
let text = bufcount ==# 1 ? execute('enew') : execute('bp')
silent execute 'bw #'
endfunction
map <leader>d :call DeleteHiddenBuffers()<CR>
function! DeleteHiddenBuffers()
let tpbl=[]
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
silent execute 'bwipeout' buf
endfor
endfunction
if has('persistent_undo')
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
endif
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set t_Co=256
set termguicolors
set background=dark
colorscheme gruvbox
nnoremap <leader>v :e $MYVIMRC<CR>
nnoremap <leader><c-v> :e /Users/random/.config/nvim/lua/plugins.lua<CR>
nnoremap <leader>V :source $MYVIMRC<CR>
nnoremap <leader>un :syntax sync fromstart<CR>:redraw!<CR>
nnoremap <leader>fef :normal! gg=G``<CR>
nnoremap <C-k> <C-w><Up>
nnoremap <C-j> <C-w><Down>
nnoremap <C-l> <C-w><Right>
nnoremap <C-h> <C-w><Left>
nnoremap _cs :setlocal filetype=css<CR>
nnoremap _co :setlocal filetype=coffee<CR>
nnoremap _ht :setlocal filetype=html<CR>
nnoremap _sl :setlocal filetype=slim<CR>
nnoremap _js :setlocal filetype=javascript<CR>
nnoremap _md :setlocal filetype=markdown<CR>
nnoremap _rb :setlocal filetype=ruby<CR>
nnoremap _sh :setlocal filetype=sh<CR>
nnoremap _vi :setlocal filetype=vim<CR>
nnoremap _an :setlocal filetype=yaml.ansible<CR>
nnoremap _dc :setlocal filetype=dockerfile<CR>
map <leader>cs :call CreateSpec()<CR>
function! CreateSpec()
" This function requires tpope/rails.vim
let l:file_path = expand('%')
let l:spec_path = substitute(l:file_path, '\vapp\/(.+)\.rb', '\1', '')
echo 'Espec ' . l:spec_path . '!'
execute 'Espec ' . l:spec_path . '!'
endfunction
let g:elite_mode = 1
if get(g:, 'elite_mode')
nnoremap <Up> :resize +2<CR>
nnoremap <Down> :resize -2<CR>
nnoremap <Left> :vertical resize +2<CR>
nnoremap <Right> :vertical resize -2<CR>
endif
if has('nvim')
tmap <C-o> <C-\><C-n>
end
nnoremap Q @q
vnoremap Q :norm @q<cr>
vnoremap // y/<C-R>"<CR>
nnoremap <silent> // :nohlsearch<CR>
inoremap <C-c> <Esc><Esc>
map <leader>/ :call AddPry()<CR>
function! AddPry()
if &filetype == 'ruby'
execute "normal obinding.pry\<Esc>"
elseif &filetype == 'svelte' || &filetype == 'js' || &filetype == 'ts'
execute "normal odebugger\<Esc>"
else
execute "normal obinding.pry\<Esc>"
end
endfunction
lua require('plugins')
let g:loaded_sql_completion = 0
let g:omni_sql_no_default_maps = 1
" vim:foldmethod=marker: