summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-08-30 18:18:12 +0200
committerRobert Günzler <r@gnzler.io>2021-08-31 12:41:19 +0200
commitf0cb9f1f65c103a86447f9bbed64bd98a0b36cd8 (patch)
tree13fe9772eb1def4c376f0adecc9db74af08c17a1
parent8bca81886ab94963531b77b96b37c9f1fea20583 (diff)
vim: cleanup
-rw-r--r--.vim/init.lua19
-rw-r--r--.vim/lua/plugins.lua2
2 files changed, 10 insertions, 11 deletions
diff --git a/.vim/init.lua b/.vim/init.lua
index ac7eb9e..f7e5363 100644
--- a/.vim/init.lua
+++ b/.vim/init.lua
@@ -62,7 +62,6 @@ cmd [[ colorscheme lush ]]
 
 -- KEY BINDS -- {{{
 local nnoremap = require('astronauta.keymap').nnoremap
-local inoremap = require('astronauta.keymap').inoremap
 local vnoremap = require('astronauta.keymap').vnoremap
 local tnoremap = require('astronauta.keymap').tnoremap
 
@@ -71,18 +70,18 @@ nnoremap { 'gb', function() cmd [[ bnext ]] end }
 nnoremap { 'gB', function() cmd [[ bprevious ]] end }
 nnoremap { '<tab>',  function() cmd [[ silent! normal za ]] end }
 
--- terminal
 tnoremap { '<esc>', [[ <c-\><c-n> ]] }
 tnoremap { '<leader>qq', [[ <c-\><c-n> :bdelete!<cr> ]] }
 vnoremap { 'T', function() cmd [[ retab! | call feedkeys("\<esc>") ]] end }
 
-nnoremap { 'gf',  function() require('misc').file_under_cursor(function(s) vim.cmd('edit ' .. s) end) end }
-nnoremap { 'gF',  function() require('misc').open_under_cursor() end }
-nnoremap { 'gx',  function() require('misc').open_under_cursor('url-launcher') end }
-nnoremap { 'gGw', function() require('misc').word_under_cursor(function(s) require('telescope.builtin.files').grep_string({ search = s }) end) end }
-nnoremap { 'gGe', function() require('misc').expr_under_cursor(function(s) require('telescope.builtin.files').grep_string({ search = s }) end) end }
-nnoremap { 'gGf', function() require('misc').file_under_cursor(function(s) require('telescope.builtin.files').grep_string({ search = s }) end) end }
-nnoremap { 'gs',  function() require('misc').word_under_cursor(function(s) vim.fn.feedkeys(':%s/' .. s .. '//g'); cmd [[ call feedkeys("\<left>\<left>") ]] end) end }
+local misc = require('misc')
+nnoremap { 'gf',  function() misc.file_under_cursor(function(s) vim.cmd('edit ' .. s) end) end }
+nnoremap { 'gF',  function() misc.open_under_cursor() end }
+nnoremap { 'gx',  function() misc.open_under_cursor('url-launcher') end }
+nnoremap { 'gGw', function() misc.word_under_cursor(function(s) require('telescope.builtin.files').grep_string({ search = s }) end) end }
+nnoremap { 'gGe', function() misc.expr_under_cursor(function(s) require('telescope.builtin.files').grep_string({ search = s }) end) end }
+nnoremap { 'gGf', function() misc.file_under_cursor(function(s) require('telescope.builtin.files').grep_string({ search = s }) end) end }
+nnoremap { 'gs',  function() misc.word_under_cursor(function(s) vim.fn.feedkeys(':%s/' .. s .. '//g'); cmd [[ call feedkeys("\<left>\<left>") ]] end) end }
 -- }}}
 
 -- AUTO GROUPS -- {{{
@@ -107,7 +106,7 @@ augroup {
 
 -- USER COMMANDS -- {{{
 cmd [[ command! BalenaDiagnosticsFold call balena_diagnostics_fold#apply() ]]
-cmd [[ command! -range SortLine <line1>,<line2>lua require('misc').sort_line() ]]
+cmd [[ command! -range SortLine <line1>,<line2>lua misc.sort_line() ]]
 cmd [[ command! -nargs=* Make lua require('job').make({<f-args>}) ]]
 cmd [[ command! -nargs=* Sh lua require('job').sh(table.concat({<f-args>}, ' ')) ]]
 -- }}}
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua
index ab3ac2b..2e9c51a 100644
--- a/.vim/lua/plugins.lua
+++ b/.vim/lua/plugins.lua
@@ -15,7 +15,7 @@ if not vim.fn.filewritable(vim.fn.stdpath('cache')) == 2 then
   return
 end
 
-function disable_distribution_plugins() --{{{
+local function disable_distribution_plugins() -- {{{
   g.loaded_gzip              = 1
   g.loaded_tar               = 1
   g.loaded_tarPlugin         = 1