Compare commits
No commits in common. "f2f4b9f91ef52170369f7ea198a9fb23c54d3dc2" and "f0b590c29eb0835ee345db01d51fc2d94cb72967" have entirely different histories.
f2f4b9f91e
...
f0b590c29e
3 changed files with 22 additions and 21 deletions
|
|
@ -81,6 +81,7 @@ in
|
|||
cmp-buffer # Words from open buffers
|
||||
cmp-nvim-lsp # LSP suggestions
|
||||
cmp-nvim-lua # NeoVim lua API
|
||||
cmp-path # Path name suggestions
|
||||
cmp-under-comparator # Sort items that start with '_' lower
|
||||
cmp_luasnip # Snippet suggestions from LuaSnip
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ local M = {}
|
|||
-- Simplified LSP formatting configuration
|
||||
local lsp_format = require("lsp-format")
|
||||
|
||||
--- Move to the next/previous diagnostic, automatically showing the diagnostics
|
||||
--- float if necessary.
|
||||
--- @param forward whether to go forward or backwards
|
||||
-- Move to the next/previous diagnostic, automatically showing the diagnostics
|
||||
-- float if necessary.
|
||||
-- @param forward whether to go forward or backwards
|
||||
local function goto_diagnostic(forward)
|
||||
vim.validate({
|
||||
forward = { forward, "boolean" },
|
||||
|
|
@ -28,21 +28,21 @@ local function goto_diagnostic(forward)
|
|||
end
|
||||
end
|
||||
|
||||
--- Move to the next diagnostic, automatically showing the diagnostics float if
|
||||
--- necessary.
|
||||
-- Move to the next diagnostic, automatically showing the diagnostics float if
|
||||
-- necessary.
|
||||
M.goto_next_diagnostic = function()
|
||||
goto_diagnostic(true)
|
||||
end
|
||||
|
||||
--- Move to the previous diagnostic, automatically showing the diagnostics float
|
||||
--- if necessary.
|
||||
-- Move to the previous diagnostic, automatically showing the diagnostics float
|
||||
-- if necessary.
|
||||
M.goto_prev_diagnostic = function()
|
||||
goto_diagnostic(false)
|
||||
end
|
||||
|
||||
--- shared LSP configuration callback
|
||||
--- @param client native client configuration
|
||||
--- @param bufnr int? buffer number of the attched client
|
||||
-- shared LSP configuration callback
|
||||
-- @param client native client configuration
|
||||
-- @param bufnr int? buffer number of the attched client
|
||||
M.on_attach = function(client, bufnr)
|
||||
-- Format on save
|
||||
lsp_format.on_attach(client, bufnr)
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
local M = {}
|
||||
|
||||
--- pretty print lua object
|
||||
--- @param obj any object to pretty print
|
||||
-- pretty print lua object
|
||||
-- @param obj any object to pretty print
|
||||
M.dump = function(obj)
|
||||
print(vim.inspect(obj))
|
||||
end
|
||||
|
||||
--- checks if a given command is executable
|
||||
--- @param cmd string? command to check
|
||||
--- @return boolean executable
|
||||
---@param cmd string? command to check
|
||||
---@return boolean executable
|
||||
M.is_executable = function(cmd)
|
||||
return cmd and vim.fn.executable(cmd) == 1
|
||||
end
|
||||
|
||||
--- return a function that checks if a given command is executable
|
||||
--- @param cmd string? command to check
|
||||
--- @return fun(cmd: string): boolean executable
|
||||
---@param cmd string? command to check
|
||||
---@return fun(cmd: string): boolean executable
|
||||
M.is_executable_condition = function(cmd)
|
||||
return function()
|
||||
return M.is_executable(cmd)
|
||||
end
|
||||
end
|
||||
|
||||
--- whether or not we are currently in an SSH connection
|
||||
--- @return boolean ssh connection
|
||||
-- whether or not we are currently in an SSH connection
|
||||
-- @return boolean ssh connection
|
||||
M.is_ssh = function()
|
||||
local variables = {
|
||||
"SSH_CONNECTION",
|
||||
|
|
@ -40,9 +40,9 @@ M.is_ssh = function()
|
|||
return false
|
||||
end
|
||||
|
||||
--- list all active LSP clients for current buffer
|
||||
--- @param bufnr int? buffer number
|
||||
--- @return table all active LSP client names
|
||||
-- list all active LSP clients for current buffer
|
||||
-- @param bufnr int? buffer number
|
||||
-- @return table all active LSP client names
|
||||
M.list_lsp_clients = function(bufnr)
|
||||
local clients = vim.lsp.buf_get_clients(bufnr)
|
||||
local names = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue