Revisão | c7a47fbd091d5294bef249c9c7b32abf1d5f5aee (tree) |
---|---|
Hora | 2023-01-31 03:39:39 |
Autor | Markus Prepens <markus.prepens@gmai...> |
Commiter | Markus Prepens |
updates
@@ -14,6 +14,12 @@ nnoremap <buffer> K :help <C-r><C-w><CR> | ||
14 | 14 | nnoremap <buffer> <LocalLeader>f :call FormatLua()<CR> |
15 | 15 | vnoremap <buffer> <LocalLeader>f :call FormatLua()<CR> |
16 | 16 | |
17 | +" abbrev for lengthy API calls | |
18 | +iabbrev xcmd vim.api.nvim_create_user_command({name}, {command}, {*opts})<C-o>T( | |
19 | +iabbrev xmap vim.api.nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts})<C-o>T( | |
20 | +iabbrev xaug gid = vim.api.nvim_create_augroup({name}, {*opts})<C-o>T( | |
21 | +iabbrev xauc vim.api.nvim_create_autocmd({name}, {*opts})<C-o>T( | |
22 | + | |
17 | 23 | if !executable("stylua") |
18 | 24 | finish |
19 | 25 | endif |
@@ -106,12 +106,6 @@ if &diff | ||
106 | 106 | endif |
107 | 107 | command! ShowChanges vert new | set bt=nofile | r ++edit # | 0d_ | diffthis | wincmd p | diffthis |
108 | 108 | |
109 | -" Living with QWERTZ keyboards | |
110 | -execute "set langmap+=\<Char-246>[" | |
111 | -execute "set langmap+=\<Char-228>]" | |
112 | -execute "set langmap+=\<Char-214>{" | |
113 | -execute "set langmap+=\<Char-196>}" | |
114 | - | |
115 | 109 | " Switch to normal mode with special keys |
116 | 110 | inoremap <k0> <Esc> |
117 | 111 | imap <C-l> <Esc><C-l> |
@@ -183,6 +177,9 @@ nnoremap <A-h> :colder<CR> | ||
183 | 177 | nnoremap <A-l> :cnewer<CR> |
184 | 178 | nnoremap <A-j> <cmd>cnext<CR> |
185 | 179 | nnoremap <A-k> <cmd>cprevious<CR> |
180 | +" Living with QWERTZ keyboards | |
181 | +nnoremap <Char-228> <cmd>cnext<CR> | |
182 | +nnoremap <Char-246> <cmd>cprevious<CR> | |
186 | 183 | |
187 | 184 | " Window movement {{{ |
188 | 185 | noremap <S-Right> <C-w>l |
@@ -231,13 +228,13 @@ let g:ft2glob = #{ c:'*.[ch]$', vim:'*.vim', py:'*.py$', lua: '*.lua', cmake:'*c | ||
231 | 228 | nnoremap <expr> <Leader>v ':silent vimgrep /' .. expand("<cword>") .. '/ ' .. expand("%:h") .. g:slash .. LsFilter(&ft) |
232 | 229 | |
233 | 230 | """ :buffer, :edit and :find |
231 | +nnoremap <Leader>d <Cmd>bdelete<CR> | |
234 | 232 | nnoremap <Leader>t <cmd>tab split<CR> |
235 | 233 | nnoremap <Leader>e :edit<space> |
236 | 234 | nnoremap <Leader>, :edit <C-r>=stdpath("config") .. g:slash<CR> |
237 | 235 | nnoremap <Leader>. :edit <C-r>=expand("%:h")=="." ? ".\\" : expand("%:h") .. g:slash<CR> |
238 | 236 | nnoremap <Leader>b :buffer<space> |
239 | 237 | nnoremap <Leader>f :find<Space> |
240 | -nnoremap <Leader>x <Cmd>bdelete<CR> | |
241 | 238 | |
242 | 239 | """ Call Wordnik |
243 | 240 | nnoremap <silent> <Leader>W :silent !start https://www.wordnik.com/words/<C-r>=tolower(expand("<cword>"))<CR><CR> |
@@ -271,7 +268,7 @@ function! s:ToggleQuickfix() | ||
271 | 268 | endif |
272 | 269 | endif |
273 | 270 | endfunction |
274 | -nnoremap <Leader>c <cmd>call <SID>ToggleQuickfix()<CR> | |
271 | +nnoremap <Char-252> <cmd>call <SID>ToggleQuickfix()<CR> | |
275 | 272 | nnoremap <Leader>G <cmd>clast<CR> |
276 | 273 | |
277 | 274 | command! -nargs=0 IC :set ignorecase nosmartcase |
@@ -284,12 +281,12 @@ augroup init " {{{ | ||
284 | 281 | autocmd VimEnter * execute "colorscheme " .. (exists("g:GuiLoaded") ? "twotone" : "apollo") |
285 | 282 | autocmd FocusLost * silent wall |
286 | 283 | autocmd BufEnter * if &pvw | setlocal nonu nornu | endif |
287 | - autocmd TextYankPost * silent! lua vim.highlight.on_yank {higroup="Visual", timeout=150} | |
284 | + autocmd TextYankPost * silent! lua vim.highlight.on_yank {higroup="Visual", timeout=300} | |
288 | 285 | autocmd TermOpen * setlocal winhighlight=Normal:CursorLine,NormalNC:CursorLine nonumber norelativenumber |
289 | 286 | augroup END |
290 | 287 | " }}} |
291 | 288 | |
292 | -nnoremap <silent> <C-Space> <Cmd>lua MeltWhitespace()<CR> | |
289 | +nnoremap <silent> <Leader><Space> <Cmd>lua MeltWhitespace()<CR> | |
293 | 290 | inoremap <silent> <C-Space> <Cmd>lua MeltWhitespace()<CR> |
294 | 291 | |
295 | 292 | nnoremap <Leader>h <Cmd>ToggleHlWord<CR> |
@@ -339,8 +336,11 @@ endfunction | ||
339 | 336 | " }}} |
340 | 337 | |
341 | 338 | " Compact mouse menu {{{ |
342 | -aunmenu PopUp.How-to\ disable\ mouse | |
343 | -"aunmenu PopUp.-1- | |
339 | +try | |
340 | + aunmenu PopUp.How-to\ disable\ mouse | |
341 | + "aunmenu PopUp.-1- | |
342 | +catch /.*/ | |
343 | +endtry | |
344 | 344 | " }}} |
345 | 345 | |
346 | 346 | let g:term = &term |
@@ -51,24 +51,23 @@ function RunAsync.start(args) | ||
51 | 51 | efm = self.regexp, |
52 | 52 | }) |
53 | 53 | local qflist = |
54 | - vim.fn.getqflist({ id = self.qflist_id, all = 0 }).items | |
55 | - if #qflist > 0 then | |
56 | - local errors = vim.fn.filter(qflist, function(k, v) | |
57 | - return v["type"] == "e" | |
58 | - end) | |
59 | - local warnings = vim.fn.filter(qflist, function(k, v) | |
60 | - return v["type"] == "w" | |
61 | - end) | |
62 | - self.infotext.update( | |
63 | - "[" | |
64 | - .. #qflist | |
65 | - .. " lines | " | |
66 | - .. #warnings | |
67 | - .. " warnings | " | |
68 | - .. #errors | |
69 | - .. " errors]" | |
70 | - ) | |
71 | - end | |
54 | + vim.fn.getqflist({ id = self.qflist_id, all = 0 }).items | |
55 | + -- vim.notity(vim.inspect(qflist)) | |
56 | + local errors = vim.fn.filter(qflist, function(k, v) | |
57 | + return v["type"] == "e" | |
58 | + end) | |
59 | + local warnings = vim.fn.filter(qflist, function(k, v) | |
60 | + return v["type"] == "w" | |
61 | + end) | |
62 | + self.infotext.update( | |
63 | + "[" | |
64 | + .. #qflist | |
65 | + .. " lines | " | |
66 | + .. #warnings | |
67 | + .. " warnings | " | |
68 | + .. #errors | |
69 | + .. " errors]" | |
70 | + ) | |
72 | 71 | end |
73 | 72 | end |
74 | 73 |
@@ -46,7 +46,7 @@ function rg_find_files(str) | ||
46 | 46 | local matches = {} |
47 | 47 | handle:close() |
48 | 48 | |
49 | - vim.cmd("tabnew") | |
49 | + vim.cmd("enew") | |
50 | 50 | for token in string.gmatch(result, "[^%s]+") do |
51 | 51 | table.insert( matches, token) |
52 | 52 | end |