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`
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
local lspkind = require('lspkind')
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ require('lazy').setup({
|
|||
|
||||
-- Useful status updates for LSP
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
'folke/neodev.nvim',
|
||||
|
@ -51,7 +51,7 @@ require('lazy').setup({
|
|||
},
|
||||
|
||||
-- Useful plugin to show you pending keybinds.
|
||||
{ 'folke/which-key.nvim', opts = {} },
|
||||
{ 'folke/which-key.nvim', opts = {} },
|
||||
{
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
'lewis6991/gitsigns.nvim',
|
||||
|
@ -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
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
|
@ -192,7 +228,7 @@ require('lazy').setup({
|
|||
build = ':TSUpdate',
|
||||
},
|
||||
|
||||
require 'kickstart.plugins.autoformat',
|
||||
-- require 'kickstart.plugins.autoformat',
|
||||
-- require 'kickstart.plugins.debug',
|
||||
-- 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
|
||||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
|
||||
bashls = {},
|
||||
cssls = {},
|
||||
docker_compose_language_service = {},
|
||||
dockerls = {},
|
||||
gopls = {},
|
||||
html = {},
|
||||
jsonls = {},
|
||||
kotlin_language_server = {},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
|
@ -90,6 +91,15 @@ local servers = {
|
|||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
},
|
||||
},
|
||||
marksman = {},
|
||||
mutt_ls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
tailwindcss = {},
|
||||
tsserver = {},
|
||||
yamlls = {},
|
||||
zls = {},
|
||||
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
|
@ -104,6 +114,7 @@ local mason_lspconfig = require 'mason-lspconfig'
|
|||
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
automatic_installation = true,
|
||||
}
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
|
|
|
@ -4,12 +4,17 @@
|
|||
vim.defer_fn(function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- 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!)
|
||||
auto_install = true,
|
||||
|
||||
highlight = { enable = true },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
|
|
Loading…
Add table
Reference in a new issue