more nvim
This commit is contained in:
parent
37872eb856
commit
6a6580cef9
4 changed files with 64 additions and 13 deletions
|
@ -2,7 +2,6 @@
|
||||||
-- See `:help cmp`
|
-- See `:help cmp`
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
local lspkind = require('lspkind')
|
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
luasnip.config.setup {}
|
luasnip.config.setup {}
|
||||||
|
|
||||||
|
|
|
@ -183,6 +183,42 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
event = { 'BufReadPre', 'BufNewFile' },
|
||||||
|
config = function()
|
||||||
|
local conform = require 'conform'
|
||||||
|
|
||||||
|
conform.setup {
|
||||||
|
formatters_by_ft = {
|
||||||
|
bash = { 'beautysh', 'shellharden' },
|
||||||
|
css = { { 'prettierd', 'prettier' } },
|
||||||
|
html = { 'htmlbeautifier' },
|
||||||
|
javascript = { { 'prettierd', 'prettier' } },
|
||||||
|
javascriptreact = { { 'prettierd', 'prettier' } },
|
||||||
|
json = { { 'prettierd', 'prettier' } },
|
||||||
|
kotlin = { 'ktlint' },
|
||||||
|
lua = { 'stylua' },
|
||||||
|
markdown = { { 'prettierd', 'prettier' } },
|
||||||
|
rust = { 'rustfmt' },
|
||||||
|
scss = { { 'prettierd', 'prettier' } },
|
||||||
|
sh = { 'shellharden', 'beautysh' },
|
||||||
|
toml = { 'taplo' },
|
||||||
|
typescript = { { 'prettierd', 'prettier' } },
|
||||||
|
typescriptreact = { { 'prettierd', 'prettier' } },
|
||||||
|
yaml = { 'yamlfix' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>f', function()
|
||||||
|
conform.format {
|
||||||
|
lsp_fallback = true,
|
||||||
|
async = true,
|
||||||
|
timeout_ms = 500,
|
||||||
|
}
|
||||||
|
end, { desc = 'Format file or range (in visual mode)' })
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
-- Highlight, edit, and navigate code
|
-- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
@ -192,7 +228,7 @@ require('lazy').setup({
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
},
|
},
|
||||||
|
|
||||||
require 'kickstart.plugins.autoformat',
|
-- require 'kickstart.plugins.autoformat',
|
||||||
-- require 'kickstart.plugins.debug',
|
-- require 'kickstart.plugins.debug',
|
||||||
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
||||||
}, {})
|
}, {})
|
||||||
|
|
|
@ -75,13 +75,14 @@ require('mason-lspconfig').setup()
|
||||||
-- If you want to override the default filetypes that your language server will attach to you can
|
-- If you want to override the default filetypes that your language server will attach to you can
|
||||||
-- define the property 'filetypes' to the map in question.
|
-- define the property 'filetypes' to the map in question.
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
bashls = {},
|
||||||
-- gopls = {},
|
cssls = {},
|
||||||
-- pyright = {},
|
docker_compose_language_service = {},
|
||||||
-- rust_analyzer = {},
|
dockerls = {},
|
||||||
-- tsserver = {},
|
gopls = {},
|
||||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
html = {},
|
||||||
|
jsonls = {},
|
||||||
|
kotlin_language_server = {},
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = { checkThirdParty = false },
|
workspace = { checkThirdParty = false },
|
||||||
|
@ -90,6 +91,15 @@ local servers = {
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
-- diagnostics = { disable = { 'missing-fields' } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
marksman = {},
|
||||||
|
mutt_ls = {},
|
||||||
|
pyright = {},
|
||||||
|
rust_analyzer = {},
|
||||||
|
tailwindcss = {},
|
||||||
|
tsserver = {},
|
||||||
|
yamlls = {},
|
||||||
|
zls = {},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Setup neovim lua configuration
|
-- Setup neovim lua configuration
|
||||||
|
@ -104,6 +114,7 @@ local mason_lspconfig = require 'mason-lspconfig'
|
||||||
|
|
||||||
mason_lspconfig.setup {
|
mason_lspconfig.setup {
|
||||||
ensure_installed = vim.tbl_keys(servers),
|
ensure_installed = vim.tbl_keys(servers),
|
||||||
|
automatic_installation = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers {
|
mason_lspconfig.setup_handlers {
|
||||||
|
|
|
@ -4,12 +4,17 @@
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
-- Add languages to be installed here that you want installed for treesitter
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
|
ensure_installed = {
|
||||||
|
'markdown_inline' -- Markdown has/needs(atm) 2 packages and this one isn't installed automatically
|
||||||
|
},
|
||||||
|
|
||||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
|
||||||
highlight = { enable = true },
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue