neovim part 6
This commit is contained in:
parent
d8c82c966b
commit
97482df1a5
14 changed files with 258 additions and 194 deletions
11
.config/nvim/lua/config/plugins/languages/flutter.lua
Normal file
11
.config/nvim/lua/config/plugins/languages/flutter.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
'nvim-flutter/flutter-tools.nvim',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'stevearc/dressing.nvim', -- optional for vim.ui.select
|
||||
},
|
||||
config = function()
|
||||
require('flutter-tools').setup({})
|
||||
end,
|
||||
}
|
111
.config/nvim/lua/config/plugins/languages/lsp.lua
Normal file
111
.config/nvim/lua/config/plugins/languages/lsp.lua
Normal file
|
@ -0,0 +1,111 @@
|
|||
return {
|
||||
{
|
||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua',
|
||||
opts = {
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{ 'williamboman/mason.nvim', opts = {} },
|
||||
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Useful status updates for LSP.
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
'saghen/blink.cmp',
|
||||
},
|
||||
config = function()
|
||||
|
||||
vim.diagnostic.config {
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
signs = vim.g.have_nerd_font and {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = ' ',
|
||||
[vim.diagnostic.severity.WARN] = ' ',
|
||||
[vim.diagnostic.severity.INFO] = ' ',
|
||||
},
|
||||
} or {},
|
||||
virtual_text = {
|
||||
source = 'if_many',
|
||||
spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
rust_analyzer = {},
|
||||
pyright = {},
|
||||
|
||||
emmet_language_server = {},
|
||||
html = { filetypes = { 'html', 'htmldjango' }, },
|
||||
cssls = {},
|
||||
|
||||
-- -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- ts_ls = {},
|
||||
--
|
||||
|
||||
lua_ls = {
|
||||
-- cmd = { ... },
|
||||
-- filetypes = { ... },
|
||||
-- capabilities = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
|
||||
require('mason-lspconfig').setup {
|
||||
ensure_installed = ensure_installed,
|
||||
automatic_installation = false,
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
end,
|
||||
}
|
||||
}
|
||||
-- WARN: Temoraray workaround because of naming issue i.e. djlsp and django-template-server
|
||||
require('lspconfig').djlsp.setup({})
|
||||
end
|
||||
},
|
||||
}
|
27
.config/nvim/lua/config/plugins/languages/molten.lua
Normal file
27
.config/nvim/lua/config/plugins/languages/molten.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
{
|
||||
'3rd/image.nvim',
|
||||
version = '1.1.0',
|
||||
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
|
||||
opts = {
|
||||
backend = 'kitty', -- whatever backend you would like to use
|
||||
max_width = 100,
|
||||
max_height = 20,
|
||||
max_height_window_percentage = math.huge,
|
||||
max_width_window_percentage = math.huge,
|
||||
window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
|
||||
window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '' },
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
'benlubas/molten-nvim',
|
||||
version = '^1.0.0', -- use version <2.0.0 to avoid breaking changes
|
||||
dependencies = { '3rd/image.nvim' },
|
||||
build = ':UpdateRemotePlugins',
|
||||
init = function()
|
||||
-- these are examples, not defaults. Please see the readme
|
||||
vim.g.molten_image_provider = 'image.nvim'
|
||||
end,
|
||||
}
|
||||
}
|
23
.config/nvim/lua/config/plugins/languages/treesitter.lua
Normal file
23
.config/nvim/lua/config/plugins/languages/treesitter.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'css', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'rust', 'python', 'htmldjango', 'r', 'dart' },
|
||||
auto_install = false,
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
||||
-- If you are experiencing weird indenting issues, add the language to
|
||||
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
||||
-- additional_vim_regex_highlighting = { 'ruby' },
|
||||
},
|
||||
indent = { enable = true },
|
||||
},
|
||||
-- There are additional nvim-treesitter modules that you can use to interact
|
||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||
--
|
||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue