Compare commits
6 Commits
274e567d83
...
54a074cf21
Author | SHA1 | Date |
---|---|---|
|
54a074cf21 | |
|
f32d58e92f | |
|
9d637e58c8 | |
|
aa78891b98 | |
|
a2ee74b73a | |
|
f84576f525 |
16
init.lua
16
init.lua
|
@ -1,3 +1,6 @@
|
|||
require("options")
|
||||
require("keymaps")
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
|
@ -11,15 +14,6 @@ if not vim.loop.fs_stat(lazypath) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("options")
|
||||
require("keymaps")
|
||||
require("lazy").setup("plugins")
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
vim.cmd "colorscheme rose-pine"
|
||||
require("lazy").setup({ { import = "plugins" }, { import = "plugins.lsp" }, { import = "plugins.themes" } })
|
||||
|
||||
require('Comment').setup()
|
||||
require("setup/lualine")
|
||||
require("setup/bufferline")
|
||||
require("setup/nvim-cmp")
|
||||
require("setup/lsp")
|
||||
require("setup/toggle-diagnostics")
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
|
|
|
@ -17,49 +17,49 @@ map("n", "<leader>d", ":ToggleDiag<cr>") -- toggle all diagnostics
|
|||
|
||||
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
desc = 'LSP actions',
|
||||
callback = function()
|
||||
local bufmap = function(mode, lhs, rhs)
|
||||
local opts = {buffer = true}
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
-- Displays hover information about the symbol under the cursor
|
||||
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||
|
||||
-- Jump to the definition
|
||||
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||
|
||||
-- Jump to declaration
|
||||
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||
|
||||
-- Lists all the implementations for the symbol under the cursor
|
||||
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
|
||||
|
||||
-- Jumps to the definition of the type symbol
|
||||
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||
|
||||
-- Lists all the references
|
||||
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
|
||||
|
||||
-- Displays a function's signature information
|
||||
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||
|
||||
-- Renames all references to the symbol under the cursor
|
||||
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||
|
||||
-- Selects a code action available at the current cursor position
|
||||
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||
|
||||
-- Show diagnostics in a floating window
|
||||
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||
|
||||
-- Move to the previous diagnostic
|
||||
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||
|
||||
-- Move to the next diagnostic
|
||||
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||
end
|
||||
})
|
||||
|
||||
-- vim.api.nvim_create_autocmd('LspAttach', {
|
||||
-- desc = 'LSP actions',
|
||||
-- callback = function()
|
||||
-- local bufmap = function(mode, lhs, rhs)
|
||||
-- local opts = {buffer = true}
|
||||
-- vim.keymap.set(mode, lhs, rhs, opts)
|
||||
-- end
|
||||
--
|
||||
-- -- Displays hover information about the symbol under the cursor
|
||||
-- bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||
--
|
||||
-- -- Jump to the definition
|
||||
-- bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||
--
|
||||
-- -- Jump to declaration
|
||||
-- bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||
--
|
||||
-- -- Lists all the implementations for the symbol under the cursor
|
||||
-- bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
|
||||
--
|
||||
-- -- Jumps to the definition of the type symbol
|
||||
-- bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||
--
|
||||
-- -- Lists all the references
|
||||
-- bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
|
||||
--
|
||||
-- -- Displays a function's signature information
|
||||
-- bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||
--
|
||||
-- -- Renames all references to the symbol under the cursor
|
||||
-- bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||
--
|
||||
-- -- Selects a code action available at the current cursor position
|
||||
-- bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||
--
|
||||
-- -- Show diagnostics in a floating window
|
||||
-- bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||
--
|
||||
-- -- Move to the previous diagnostic
|
||||
-- bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||
--
|
||||
-- -- Move to the next diagnostic
|
||||
-- bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||
-- end
|
||||
-- })
|
||||
--
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
return {
|
||||
{"nvim-treesitter/nvim-treesitter"},
|
||||
{'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
lazy = false,
|
||||
},
|
||||
{"rose-pine/neovim", name = "rose-pine"},
|
||||
{ "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...},
|
||||
{"nvim-lualine/lualine.nvim", dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
}
|
||||
},
|
||||
{"folke/zen-mode.nvim",
|
||||
opts = {
|
||||
window = {width = 60}}
|
||||
},
|
||||
{"folke/twilight.nvim", opts = {context = 1}},
|
||||
{"preservim/vim-pencil"},
|
||||
{"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
},
|
||||
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'},
|
||||
{"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
},
|
||||
--##################################################
|
||||
--## LANGUAGE SERVER CONFIGS
|
||||
--##################################################
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
--#################################################
|
||||
--## AUTOCOMPLETION/SNIPPETS
|
||||
--#################################################
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
{"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
---#####################################################################
|
||||
---## LINTING
|
||||
---#####################################################################
|
||||
"mfussenegger/nvim-lint",
|
||||
"WhoIsSethDaniel/toggle-lsp-diagnostics.nvim"
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
require("bufferline").setup({})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
return {'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
lazy = false,
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
return {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function()
|
||||
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local select_opts = { behavior = cmp.SelectBehavior.Select }
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lsp", keyword_length = 1 },
|
||||
{ name = "buffer", keyword_length = 3 },
|
||||
{ name = "luasnip", keyword_length = 2 },
|
||||
},
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "menu", "abbr", "kind" },
|
||||
format = function(entry, item)
|
||||
local menu_icon = {
|
||||
nvim_lsp = "λ",
|
||||
luasnip = "⋗",
|
||||
buffer = "Ω",
|
||||
path = "🖫",
|
||||
}
|
||||
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<Up>"] = cmp.mapping.select_prev_item(select_opts),
|
||||
["<Down>"] = cmp.mapping.select_next_item(select_opts),
|
||||
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(select_opts),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(select_opts),
|
||||
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
|
||||
["<C-f>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<C-b>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
local col = vim.fn.col(".") - 1
|
||||
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item(select_opts)
|
||||
elseif col == 0 or vim.fn.getline("."):sub(col, col):match("%s") then
|
||||
fallback()
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item(select_opts)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
svelte = { "eslint_d" },
|
||||
python = { "pylint" },
|
||||
markdown = { "proselint" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"WhoIsSethDaniel/toggle-lsp-diagnostics.nvim",
|
||||
config = function()
|
||||
require("toggle_lsp_diagnostics").init({
|
||||
start_on = false,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
return {"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
|
||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup {
|
||||
-- ensure_installed = { "lua_ls", "grammarly", "ltex" },
|
||||
}
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = lsp_capabilities,
|
||||
settings = {
|
||||
|
@ -27,6 +26,10 @@ lspconfig.lua_ls.setup {
|
|||
-- return require'lspconfig'.util.find_git_ancestor(fname) or vim.loop.os_homedir()
|
||||
-- end,
|
||||
-- }
|
||||
-- require("lspconfig").marksman.setup {
|
||||
-- lspconfig.marksman.setup {
|
||||
-- capabilities = lsp_capabilities,
|
||||
-- }
|
||||
|
||||
end
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
dependencies = { "WhoIsSethDaniel/mason-tool-installer.nvim" },
|
||||
config = function()
|
||||
-- import mason
|
||||
local mason = require("mason")
|
||||
local mason_tool_installer = require("mason-tool-installer")
|
||||
|
||||
-- enable mason and configure icons
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
mason_tool_installer.setup({
|
||||
ensure_installed = {
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"isort", -- python formatter
|
||||
"black", -- python formatter
|
||||
"pylint", -- python linter
|
||||
"eslint_d", -- js linter
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- {"williamboman/mason-lspconfig.nvim",
|
||||
-- config = function()
|
||||
-- local mason_lspconfig = require("mason-lspconfig")
|
||||
-- mason_lspconfig.setup {
|
||||
-- ensure_installed = { "grammarly", "ltex" },
|
||||
-- }
|
||||
-- end
|
||||
-- }
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local function getWords()
|
||||
return tostring(vim.fn.wordcount().words)
|
||||
end
|
||||
require("lualine").setup({
|
||||
sections = {
|
||||
lualine_z = { getWords },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
return {"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
return { "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...}
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
return {"rose-pine/neovim", name = "rose-pine"}
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
return {"folke/twilight.nvim", opts = {context = 1}}
|
|
@ -0,0 +1 @@
|
|||
return {"preservim/vim-pencil"}
|
|
@ -0,0 +1,12 @@
|
|||
return {"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
return {"folke/zen-mode.nvim",
|
||||
opts = {
|
||||
window = {width = 60}}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
require("bufferline").setup{}
|
|
@ -1,8 +0,0 @@
|
|||
local function getWords()
|
||||
return tostring(vim.fn.wordcount().words)
|
||||
end
|
||||
require('lualine').setup {
|
||||
sections = {
|
||||
lualine_z = { getWords },
|
||||
},
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
require("neo-tree").setup({})
|
|
@ -1,85 +0,0 @@
|
|||
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
local select_opts = {behavior = cmp.SelectBehavior.Select}
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
sources = {
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp', keyword_length = 1},
|
||||
{name = 'buffer', keyword_length = 3},
|
||||
{name = 'luasnip', keyword_length = 2},
|
||||
},
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered()
|
||||
},
|
||||
formatting = {
|
||||
fields = {'menu', 'abbr', 'kind'},
|
||||
format = function(entry, item)
|
||||
local menu_icon = {
|
||||
nvim_lsp = 'λ',
|
||||
luasnip = '⋗',
|
||||
buffer = 'Ω',
|
||||
path = '🖫',
|
||||
}
|
||||
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<Up>'] = cmp.mapping.select_prev_item(select_opts),
|
||||
['<Down>'] = cmp.mapping.select_next_item(select_opts),
|
||||
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(select_opts),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(select_opts),
|
||||
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-y>'] = cmp.mapping.confirm({select = true}),
|
||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||
|
||||
['<C-f>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
|
||||
['<C-b>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
local col = vim.fn.col('.') - 1
|
||||
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item(select_opts)
|
||||
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||
fallback()
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item(select_opts)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
},
|
||||
})
|
|
@ -1,9 +0,0 @@
|
|||
require('lint').linters_by_ft = {
|
||||
markdown = {'proselint',}
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
|
@ -1,3 +0,0 @@
|
|||
require('toggle_lsp_diagnostics').init({
|
||||
start_on = false,
|
||||
})
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue