fix some telescope stuff.

This commit is contained in:
Jeremy Wall 2023-08-28 14:08:20 -04:00
parent 9293dee5eb
commit 4478387b93
2 changed files with 34 additions and 10 deletions

View File

@ -54,10 +54,15 @@ au BufNewFile,BufRead *.hrl filetype indent off
--https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md --https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
local caps = vim.tbl_deep_extend(
'force',
vim.lsp.protocol.make_client_capabilities(),
{}
);
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
-- Nix language server support -- Nix language server support
lspconfig.nil_ls.setup{{ lspconfig.nil_ls.setup{}
}}
local vim_pid = vim.fn.getpid() local vim_pid = vim.fn.getpid()
@ -133,14 +138,23 @@ vim.api.nvim_create_autocmd('LspAttach', {
end, opts) end, opts)
vim.keymap.set({"n", "v"}, "<Leader>a", vim.lsp.buf.code_action, opts) vim.keymap.set({"n", "v"}, "<Leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, opts) vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, opts)
-- We use F2 to rename things local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.codelens then
vim.lsp.codelens.refresh()
end
end, end,
}) })
vim.api.nvim_create_autocmd({'LspAttach', 'BufEnter', 'InsertLeave', 'CursorHold'}, { vim.api.nvim_create_autocmd({'BufEnter', 'InsertLeave', 'CursorHold'}, {
callback = function(ev) callback = function(_)
if vim.lsp.buf.server_ready() then if vim.lsp.buf.server_ready() then
vim.lsp.codelens.refresh() local clients = vim.lsp.get_active_clients()
for cid = 1, #clients do
if clients[cid].server_capabilities.codelens then
vim.lsp.codelens.refresh()
break
end
end
end end
end, end,
}) })
@ -217,6 +231,7 @@ require('nvim-treesitter.configs').setup {
max_file_lines = nil, max_file_lines = nil,
}, },
--textobjects = { --textobjects = {
-- enable = true,
-- select = { -- select = {
-- enable = true, -- enable = true,
-- lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim -- lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
@ -355,12 +370,17 @@ end)
-- Telelscope configuration -- Telelscope configuration
local telescope = require('telescope') local telescope = require('telescope')
local telescope_builtins = require('telescope.builtin') local telescope_builtins = require('telescope.builtin')
--local telescope_actions = require('telescope.actions') local telescope_actions = require('telescope.actions')
-- https://github.com/nvim-telescope/telescope.nvim -- https://github.com/nvim-telescope/telescope.nvim
telescope.setup({ telescope.setup({
defaults = { defaults = {
initial_mode = "normal", initial_mode = "normal",
mappings = {
n = {
["<Leader>ql"] = telescope_actions.send_selected_to_qflist + telescope_actions.open_qflist,
},
},
}, },
}) })
@ -375,3 +395,7 @@ vim.keymap.set("n", "<Leader>rr", vim.lsp.codelens.run)
-- Show whatever errors we have in our trouble pane -- Show whatever errors we have in our trouble pane
vim.keymap.set("n", "<Leader>se", "<cmd>TroubleToggle<cr>", { silent = true, noremap = true }) vim.keymap.set("n", "<Leader>se", "<cmd>TroubleToggle<cr>", { silent = true, noremap = true })
-- logging
--vim.lsp.set_log_level("debug")
--vim.lsp.log.set_format_func(vim.inspect)

6
nix/darwin/flake.lock generated
View File

@ -34,12 +34,12 @@
}, },
"locked": { "locked": {
"lastModified": 1, "lastModified": 1,
"narHash": "sha256-NrEKLtKqw6lOwfxz2f8OAScfVPzdsZz849sAceUrOk4=", "narHash": "sha256-zUkrSqkKiphniy9Dv8MJpsJKt4HMEoPIpoW6SQyzeOQ=",
"path": "/nix/store/6s1z7nf9wb66a3gcx0fvjdbhm05bmcx4-source/nix/base-system", "path": "/nix/store/f9c9966csi39qz43kg1j16w3phnkdj4d-source/nix/base-system",
"type": "path" "type": "path"
}, },
"original": { "original": {
"path": "/nix/store/6s1z7nf9wb66a3gcx0fvjdbhm05bmcx4-source/nix/base-system", "path": "/nix/store/f9c9966csi39qz43kg1j16w3phnkdj4d-source/nix/base-system",
"type": "path" "type": "path"
} }
}, },