mirror of
https://github.com/mitchell/dotfiles.git
synced 2025-12-17 12:27:22 +00:00
Swap neovim LSP and zen mode plugins, and set kitty font
This commit is contained in:
parent
aaf5a1d0ca
commit
ed4e3a40e2
3 changed files with 86 additions and 74 deletions
|
|
@ -1,9 +1,17 @@
|
|||
vim.cmd("set runtimepath^=~/.vim runtimepath+=~/.vim/after")
|
||||
vim.cmd("let &packpath = &runtimepath")
|
||||
vim.cmd("source ~/.vimrc")
|
||||
vim.keymap.set("n", "<Esc>", "<C-\\><C-n>")
|
||||
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>")
|
||||
|
||||
require('symbols-outline').setup()
|
||||
require('twilight').setup()
|
||||
require('zen-mode').setup({
|
||||
window = {
|
||||
backdrop = 1,
|
||||
}
|
||||
})
|
||||
require('symbols-outline').setup({
|
||||
autofold_depth = 2,
|
||||
})
|
||||
require('leap').add_default_mappings()
|
||||
|
||||
require('noice').setup({
|
||||
|
|
@ -58,3 +66,58 @@ require('nvim-treesitter.configs').setup({
|
|||
enable = true
|
||||
}
|
||||
})
|
||||
|
||||
-- LSP Mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
local opts = { noremap=true, silent=true }
|
||||
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
||||
vim.keymap.set('n', '<leader>h', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<leader>m', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', '<leader>mr', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<leader>F', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
end
|
||||
|
||||
local lsp = require "lspconfig"
|
||||
local coq = require "coq"
|
||||
|
||||
|
||||
local lsp_flags = {
|
||||
-- This is the default in Nvim 0.7+
|
||||
debounce_text_changes = 150,
|
||||
}
|
||||
lsp['tsserver'].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
})
|
||||
lsp['tsserver'].setup(coq.lsp_ensure_capabilities())
|
||||
|
||||
lsp['elixirls'].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
})
|
||||
lsp['elixirls'].setup(coq.lsp_ensure_capabilities())
|
||||
|
||||
lsp['gopls'].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
})
|
||||
lsp['gopls'].setup(coq.lsp_ensure_capabilities())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue