|
@@ -1,6 +1,6 @@
|
|
-local nv_utils = {}
|
|
|
|
|
|
+local lv_utils = {}
|
|
|
|
|
|
-function nv_utils.define_augroups(definitions) -- {{{1
|
|
|
|
|
|
+function lv_utils.define_augroups(definitions) -- {{{1
|
|
-- Create autocommand groups based on the passed definitions
|
|
-- Create autocommand groups based on the passed definitions
|
|
--
|
|
--
|
|
-- The key will be the name of the group, and each definition
|
|
-- The key will be the name of the group, and each definition
|
|
@@ -24,159 +24,159 @@ end
|
|
|
|
|
|
-- lsp
|
|
-- lsp
|
|
|
|
|
|
-function nv_utils.add_to_workspace_folder()
|
|
|
|
|
|
+function lv_utils.add_to_workspace_folder()
|
|
vim.lsp.buf.add_workspace_folder()
|
|
vim.lsp.buf.add_workspace_folder()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.clear_references()
|
|
|
|
|
|
+function lv_utils.clear_references()
|
|
vim.lsp.buf.clear_references()
|
|
vim.lsp.buf.clear_references()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.code_action()
|
|
|
|
|
|
+function lv_utils.code_action()
|
|
vim.lsp.buf.code_action()
|
|
vim.lsp.buf.code_action()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.declaration()
|
|
|
|
|
|
+function lv_utils.declaration()
|
|
vim.lsp.buf.declaration()
|
|
vim.lsp.buf.declaration()
|
|
vim.lsp.buf.clear_references()
|
|
vim.lsp.buf.clear_references()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.definition()
|
|
|
|
|
|
+function lv_utils.definition()
|
|
vim.lsp.buf.definition()
|
|
vim.lsp.buf.definition()
|
|
vim.lsp.buf.clear_references()
|
|
vim.lsp.buf.clear_references()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.document_highlight()
|
|
|
|
|
|
+function lv_utils.document_highlight()
|
|
vim.lsp.buf.document_highlight()
|
|
vim.lsp.buf.document_highlight()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.document_symbol()
|
|
|
|
|
|
+function lv_utils.document_symbol()
|
|
vim.lsp.buf.document_symbol()
|
|
vim.lsp.buf.document_symbol()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.formatting()
|
|
|
|
|
|
+function lv_utils.formatting()
|
|
vim.lsp.buf.formatting()
|
|
vim.lsp.buf.formatting()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.formatting_sync()
|
|
|
|
|
|
+function lv_utils.formatting_sync()
|
|
vim.lsp.buf.formatting_sync()
|
|
vim.lsp.buf.formatting_sync()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.hover()
|
|
|
|
|
|
+function lv_utils.hover()
|
|
vim.lsp.buf.hover()
|
|
vim.lsp.buf.hover()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.implementation()
|
|
|
|
|
|
+function lv_utils.implementation()
|
|
vim.lsp.buf.implementation()
|
|
vim.lsp.buf.implementation()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.incoming_calls()
|
|
|
|
|
|
+function lv_utils.incoming_calls()
|
|
vim.lsp.buf.incoming_calls()
|
|
vim.lsp.buf.incoming_calls()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.list_workspace_folders()
|
|
|
|
|
|
+function lv_utils.list_workspace_folders()
|
|
vim.lsp.buf.list_workspace_folders()
|
|
vim.lsp.buf.list_workspace_folders()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.outgoing_calls()
|
|
|
|
|
|
+function lv_utils.outgoing_calls()
|
|
vim.lsp.buf.outgoing_calls()
|
|
vim.lsp.buf.outgoing_calls()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.range_code_action()
|
|
|
|
|
|
+function lv_utils.range_code_action()
|
|
vim.lsp.buf.range_code_action()
|
|
vim.lsp.buf.range_code_action()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.range_formatting()
|
|
|
|
|
|
+function lv_utils.range_formatting()
|
|
vim.lsp.buf.range_formatting()
|
|
vim.lsp.buf.range_formatting()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.references()
|
|
|
|
|
|
+function lv_utils.references()
|
|
vim.lsp.buf.references()
|
|
vim.lsp.buf.references()
|
|
vim.lsp.buf.clear_references()
|
|
vim.lsp.buf.clear_references()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.remove_workspace_folder()
|
|
|
|
|
|
+function lv_utils.remove_workspace_folder()
|
|
vim.lsp.buf.remove_workspace_folder()
|
|
vim.lsp.buf.remove_workspace_folder()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.rename()
|
|
|
|
|
|
+function lv_utils.rename()
|
|
vim.lsp.buf.rename()
|
|
vim.lsp.buf.rename()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.signature_help()
|
|
|
|
|
|
+function lv_utils.signature_help()
|
|
vim.lsp.buf.signature_help()
|
|
vim.lsp.buf.signature_help()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.type_definition()
|
|
|
|
|
|
+function lv_utils.type_definition()
|
|
vim.lsp.buf.type_definition()
|
|
vim.lsp.buf.type_definition()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.workspace_symbol()
|
|
|
|
|
|
+function lv_utils.workspace_symbol()
|
|
vim.lsp.buf.workspace_symbol()
|
|
vim.lsp.buf.workspace_symbol()
|
|
end
|
|
end
|
|
|
|
|
|
-- diagnostic
|
|
-- diagnostic
|
|
|
|
|
|
-function nv_utils.get_all()
|
|
|
|
|
|
+function lv_utils.get_all()
|
|
vim.lsp.diagnostic.get_all()
|
|
vim.lsp.diagnostic.get_all()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.get_next()
|
|
|
|
|
|
+function lv_utils.get_next()
|
|
vim.lsp.diagnostic.get_next()
|
|
vim.lsp.diagnostic.get_next()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.get_prev()
|
|
|
|
|
|
+function lv_utils.get_prev()
|
|
vim.lsp.diagnostic.get_prev()
|
|
vim.lsp.diagnostic.get_prev()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.goto_next()
|
|
|
|
|
|
+function lv_utils.goto_next()
|
|
vim.lsp.diagnostic.goto_next()
|
|
vim.lsp.diagnostic.goto_next()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.goto_prev()
|
|
|
|
|
|
+function lv_utils.goto_prev()
|
|
vim.lsp.diagnostic.goto_prev()
|
|
vim.lsp.diagnostic.goto_prev()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.show_line_diagnostics()
|
|
|
|
|
|
+function lv_utils.show_line_diagnostics()
|
|
vim.lsp.diagnostic.show_line_diagnostics()
|
|
vim.lsp.diagnostic.show_line_diagnostics()
|
|
end
|
|
end
|
|
|
|
|
|
-- git signs
|
|
-- git signs
|
|
|
|
|
|
-function nv_utils.next_hunk()
|
|
|
|
|
|
+function lv_utils.next_hunk()
|
|
require('gitsigns').next_hunk()
|
|
require('gitsigns').next_hunk()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.prev_hunk()
|
|
|
|
|
|
+function lv_utils.prev_hunk()
|
|
require('gitsigns').prev_hunk()
|
|
require('gitsigns').prev_hunk()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.stage_hunk()
|
|
|
|
|
|
+function lv_utils.stage_hunk()
|
|
require('gitsigns').stage_hunk()
|
|
require('gitsigns').stage_hunk()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.undo_stage_hunk()
|
|
|
|
|
|
+function lv_utils.undo_stage_hunk()
|
|
require('gitsigns').undo_stage_hunk()
|
|
require('gitsigns').undo_stage_hunk()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.reset_hunk()
|
|
|
|
|
|
+function lv_utils.reset_hunk()
|
|
require('gitsigns').reset_hunk()
|
|
require('gitsigns').reset_hunk()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.reset_buffer()
|
|
|
|
|
|
+function lv_utils.reset_buffer()
|
|
require('gitsigns').reset_buffer()
|
|
require('gitsigns').reset_buffer()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.preview_hunk()
|
|
|
|
|
|
+function lv_utils.preview_hunk()
|
|
require('gitsigns').preview_hunk()
|
|
require('gitsigns').preview_hunk()
|
|
end
|
|
end
|
|
|
|
|
|
-function nv_utils.blame_line()
|
|
|
|
|
|
+function lv_utils.blame_line()
|
|
require('gitsigns').blame_line()
|
|
require('gitsigns').blame_line()
|
|
end
|
|
end
|
|
|
|
|
|
-- misc
|
|
-- misc
|
|
-function nv_utils.file_exists(name)
|
|
|
|
|
|
+function lv_utils.file_exists(name)
|
|
local f = io.open(name, "r")
|
|
local f = io.open(name, "r")
|
|
if f ~= nil then
|
|
if f ~= nil then
|
|
io.close(f)
|
|
io.close(f)
|
|
@@ -186,5 +186,5 @@ function nv_utils.file_exists(name)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
-return nv_utils
|
|
|
|
|
|
+return lv_utils
|
|
|
|
|