updated nvim, lsp now working, now to work out what plugins I do and don't need and configure them :D
This commit is contained in:
parent
cfe7491b56
commit
f92f9ba51b
@ -20,25 +20,27 @@ require("user.impatient")
|
|||||||
require("user.indentline")
|
require("user.indentline")
|
||||||
require("user.alpha")
|
require("user.alpha")
|
||||||
require("user.whichkey")
|
require("user.whichkey")
|
||||||
|
-- Not sure I want to use this yet.
|
||||||
-- require "user.hop"
|
-- require "user.hop"
|
||||||
require("user.matchup")
|
require("user.matchup")
|
||||||
-- require "user.numb"
|
require "user.numb"
|
||||||
require("user.colorizer")
|
require("user.colorizer")
|
||||||
-- require "user.spectre"
|
require "user.spectre"
|
||||||
require("user.zen-mode")
|
require("user.zen-mode")
|
||||||
require("user.neoscroll")
|
require("user.neoscroll")
|
||||||
require("user.todo-comments")
|
require("user.todo-comments")
|
||||||
require("user.symbol-outline")
|
require("user.symbol-outline")
|
||||||
require("user.notify")
|
require("user.notify")
|
||||||
require("user.ts-context")
|
require("user.ts-context")
|
||||||
require("user.copilot")
|
-- I can look at this in Chritian Chiarulli's config if I wish, for now I can't be bothered.
|
||||||
|
-- require("user.copilot")
|
||||||
require("user.functions")
|
require("user.functions")
|
||||||
require("user.illuminate")
|
require("user.illuminate")
|
||||||
require("user.dap")
|
require("user.dap")
|
||||||
-- require "user.lir"
|
require "user.lir"
|
||||||
require("user.winbar")
|
require("user.winbar")
|
||||||
require("user.nvim-webdev-icons")
|
require("user.nvim-webdev-icons")
|
||||||
-- require "user.fidget"
|
require "user.fidget"
|
||||||
require("user.browse")
|
require("user.browse")
|
||||||
require("user.surround")
|
require("user.surround")
|
||||||
require("user.harpoon")
|
require("user.harpoon")
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
local status_ok, copilot = pcall(require, "copilot")
|
local status_ok, copilot = pcall(require, "copilot")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
|
print "copilot error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,3 @@
|
|||||||
-- vim.g.Illuminate_delay = 0
|
|
||||||
-- vim.g.Illuminate_highlightUnderCursor = 0
|
|
||||||
vim.g.Illuminate_ftblacklist = { "alpha", "NvimTree", "DressingSelect", "harpoon" }
|
vim.g.Illuminate_ftblacklist = { "alpha", "NvimTree", "DressingSelect", "harpoon" }
|
||||||
-- vim.g.Illuminate_highlightUnderCursor = 0
|
|
||||||
vim.api.nvim_set_keymap("n", "<a-n>", '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', { noremap = true })
|
vim.api.nvim_set_keymap("n", "<a-n>", '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', { noremap = true })
|
||||||
vim.api.nvim_set_keymap(
|
vim.api.nvim_set_keymap("n", "<a-p>", '<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>', { noremap = true })
|
||||||
"n",
|
|
||||||
"<a-p>",
|
|
||||||
'<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>',
|
|
||||||
{ noremap = true }
|
|
||||||
)
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
|
|||||||
-- Insert --
|
-- Insert --
|
||||||
-- Press jk fast to enter
|
-- Press jk fast to enter
|
||||||
keymap("i", "jk", "<ESC>", opts)
|
keymap("i", "jk", "<ESC>", opts)
|
||||||
|
keymap("i", "zzz", "<ESC> zz a", opts)
|
||||||
|
|
||||||
-- Visual --
|
-- Visual --
|
||||||
-- Stay in indent mode
|
-- Stay in indent mode
|
||||||
@ -61,6 +62,7 @@ keymap("n", "<leader>ff", ":Telescope find_files<CR>", opts)
|
|||||||
keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
|
keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
|
||||||
keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
|
keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
|
||||||
keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
|
keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
|
||||||
|
keymap("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
||||||
|
|
||||||
-- Goyo
|
-- Goyo
|
||||||
keymap("n", "<leader>f", ":Goyo<CR>", opts)
|
keymap("n", "<leader>f", ":Goyo<CR>", opts)
|
||||||
@ -83,7 +85,4 @@ keymap("n", "<leader>p", ":!opout <c-r>%<CR><CR>", opts)
|
|||||||
-- Attempt sudo for files that require it
|
-- Attempt sudo for files that require it
|
||||||
keymap("n", "w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', opts)
|
keymap("n", "w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', opts)
|
||||||
|
|
||||||
keymap("n", "fr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
|
||||||
keymap("n", "K", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
|
||||||
|
|
||||||
keymap("n", "<C-z>", "<cmd>ZenMode<cr>", opts)
|
keymap("n", "<C-z>", "<cmd>ZenMode<cr>", opts)
|
||||||
|
|||||||
@ -4,6 +4,7 @@ M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
|||||||
|
|
||||||
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
if not status_cmp_ok then
|
if not status_cmp_ok then
|
||||||
|
print "cmp_nvim_lsp error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
@ -77,6 +78,7 @@ local function lsp_highlight_document(client)
|
|||||||
-- if client.server_capabilities.document_highlight then
|
-- if client.server_capabilities.document_highlight then
|
||||||
local status_ok, illuminate = pcall(require, "illuminate")
|
local status_ok, illuminate = pcall(require, "illuminate")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
|
print "illuminate error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
illuminate.on_attach(client)
|
illuminate.on_attach(client)
|
||||||
@ -87,6 +89,7 @@ local function attach_navic(client, bufnr)
|
|||||||
vim.g.navic_silence = true
|
vim.g.navic_silence = true
|
||||||
local status_ok, navic = pcall(require, "nvim-navic")
|
local status_ok, navic = pcall(require, "nvim-navic")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
|
print "nvim-navic error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
navic.attach(client, bufnr)
|
navic.attach(client, bufnr)
|
||||||
@ -115,7 +118,8 @@ end
|
|||||||
|
|
||||||
M.on_attach = function(client, bufnr)
|
M.on_attach = function(client, bufnr)
|
||||||
lsp_keymaps(bufnr)
|
lsp_keymaps(bufnr)
|
||||||
lsp_highlight_document(client)
|
-- This is currently broken, not sure why.
|
||||||
|
-- lsp_highlight_document(client)
|
||||||
attach_navic(client, bufnr)
|
attach_navic(client, bufnr)
|
||||||
|
|
||||||
if client.name == "tsserver" then
|
if client.name == "tsserver" then
|
||||||
@ -134,8 +138,8 @@ end
|
|||||||
function M.enable_format_on_save()
|
function M.enable_format_on_save()
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
augroup format_on_save
|
augroup format_on_save
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWritePre * lua vim.lsp.buf.format({ async = false })
|
autocmd BufWritePre * lua vim.lsp.buf.format({ async = false })
|
||||||
augroup end
|
augroup end
|
||||||
]]
|
]]
|
||||||
vim.notify "Enabled format on save"
|
vim.notify "Enabled format on save"
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
M = {}
|
M = {}
|
||||||
|
|
||||||
local status_ok, _ = pcall(require, "lspconfig")
|
local status_ok, _ = pcall(require, "lspconfig")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
|
print "lspconfig error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -18,7 +20,7 @@ M.server_capabilities = function()
|
|||||||
return "capabilites for: " .. item
|
return "capabilites for: " .. item
|
||||||
end,
|
end,
|
||||||
}, function(choice)
|
}, function(choice)
|
||||||
-- print(active_client_map[choice])
|
print(active_client_map[choice])
|
||||||
print(vim.inspect(vim.lsp.get_active_clients()[active_client_map[choice]].server_capabilities.executeCommandProvider))
|
print(vim.inspect(vim.lsp.get_active_clients()[active_client_map[choice]].server_capabilities.executeCommandProvider))
|
||||||
vim.pretty_print(vim.lsp.get_active_clients()[active_client_map[choice]].server_capabilities)
|
vim.pretty_print(vim.lsp.get_active_clients()[active_client_map[choice]].server_capabilities)
|
||||||
end)
|
end)
|
||||||
@ -32,6 +34,7 @@ require "user.lsp.null-ls"
|
|||||||
|
|
||||||
local l_status_ok, lsp_lines = pcall(require, "lsp_lines")
|
local l_status_ok, lsp_lines = pcall(require, "lsp_lines")
|
||||||
if not l_status_ok then
|
if not l_status_ok then
|
||||||
|
print "lsp_lines error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ mason_lspconfig.setup {
|
|||||||
|
|
||||||
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||||
if not lspconfig_status_ok then
|
if not lspconfig_status_ok then
|
||||||
|
print "lspconfig error!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -51,9 +51,10 @@ return packer.startup(function(use)
|
|||||||
-- Lua Development
|
-- Lua Development
|
||||||
use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins
|
use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins
|
||||||
use "nvim-lua/popup.nvim"
|
use "nvim-lua/popup.nvim"
|
||||||
|
use "folke/lua-dev.nvim"
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
use "neovim/nvim-lspconfig" -- enable LSP
|
use "neovim/nvim-lspconfig" -- enable LSP
|
||||||
-- use "williamboman/nvim-lsp-installer" -- simple to use language server installer
|
-- use "williamboman/nvim-lsp-installer" -- simple to use language server installer
|
||||||
use "williamboman/mason.nvim"
|
use "williamboman/mason.nvim"
|
||||||
use "williamboman/mason-lspconfig.nvim"
|
use "williamboman/mason-lspconfig.nvim"
|
||||||
@ -62,16 +63,6 @@ return packer.startup(function(use)
|
|||||||
use "SmiteshP/nvim-navic"
|
use "SmiteshP/nvim-navic"
|
||||||
use "simrat39/symbols-outline.nvim"
|
use "simrat39/symbols-outline.nvim"
|
||||||
use "b0o/SchemaStore.nvim"
|
use "b0o/SchemaStore.nvim"
|
||||||
-- use "github/copilot.vim"
|
|
||||||
use {
|
|
||||||
"zbirenbaum/copilot.lua",
|
|
||||||
event = { "VimEnter" },
|
|
||||||
config = function()
|
|
||||||
vim.defer_fn(function()
|
|
||||||
require "user.copilot"
|
|
||||||
end, 100)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
use "RRethy/vim-illuminate"
|
use "RRethy/vim-illuminate"
|
||||||
use "j-hui/fidget.nvim"
|
use "j-hui/fidget.nvim"
|
||||||
use "lvimuser/lsp-inlayhints.nvim"
|
use "lvimuser/lsp-inlayhints.nvim"
|
||||||
|
|||||||
@ -52,50 +52,6 @@ M.get_filename = function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- local get_gps = function()
|
|
||||||
-- local status_gps_ok, gps = pcall(require, "nvim-gps")
|
|
||||||
-- if not status_gps_ok then
|
|
||||||
-- return ""
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- local status_ok, gps_location = pcall(gps.get_location, {})
|
|
||||||
-- if not status_ok then
|
|
||||||
-- return ""
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if not gps.is_available() or gps_location == "error" then
|
|
||||||
-- return ""
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if not require("user.functions").isempty(gps_location) then
|
|
||||||
-- return require("user.icons").ui.ChevronRight .. " " .. gps_location
|
|
||||||
-- else
|
|
||||||
-- return ""
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
local get_gps = function()
|
|
||||||
local status_gps_ok, gps = pcall(require, "nvim-navic")
|
|
||||||
if not status_gps_ok then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
local status_ok, gps_location = pcall(gps.get_location, {})
|
|
||||||
if not status_ok then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
if not gps.is_available() or gps_location == "error" then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
if not require("user.functions").isempty(gps_location) then
|
|
||||||
return require("user.icons").ui.ChevronRight .. " " .. gps_location
|
|
||||||
else
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local excludes = function()
|
local excludes = function()
|
||||||
if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then
|
if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then
|
||||||
vim.opt_local.winbar = nil
|
vim.opt_local.winbar = nil
|
||||||
@ -111,22 +67,9 @@ M.get_winbar = function()
|
|||||||
local f = require "user.functions"
|
local f = require "user.functions"
|
||||||
local value = M.get_filename()
|
local value = M.get_filename()
|
||||||
|
|
||||||
local gps_added = false
|
|
||||||
if not f.isempty(value) then
|
|
||||||
local gps_value = get_gps()
|
|
||||||
value = value .. " " .. gps_value
|
|
||||||
if not f.isempty(gps_value) then
|
|
||||||
gps_added = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not f.isempty(value) and f.get_buf_option "mod" then
|
if not f.isempty(value) and f.get_buf_option "mod" then
|
||||||
local mod = "%#LspCodeLens#" .. require("user.icons").ui.Circle .. "%*"
|
local mod = "%#LspCodeLens#" .. require("user.icons").ui.Circle .. "%*"
|
||||||
if gps_added then
|
value = value .. mod
|
||||||
value = value .. " " .. mod
|
|
||||||
else
|
|
||||||
value = value .. mod
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local num_tabs = #vim.api.nvim_list_tabpages()
|
local num_tabs = #vim.api.nvim_list_tabpages()
|
||||||
|
|||||||
@ -8,6 +8,9 @@
|
|||||||
# Adds `~/.local/bin` to $PATH
|
# Adds `~/.local/bin` to $PATH
|
||||||
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
|
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
|
||||||
|
|
||||||
|
# Userwide npm installations
|
||||||
|
export npm_config_prefix="$HOME/.local"
|
||||||
|
|
||||||
unsetopt PROMPT_SP
|
unsetopt PROMPT_SP
|
||||||
|
|
||||||
# Default programs:
|
# Default programs:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user