Compare commits
No commits in common. "54a074cf21d6338e249b2f2f7106aeb3f171579a" and "274e567d83078de6b79b87005b735a4f9f3c0b8a" have entirely different histories.
54a074cf21
...
274e567d83
32
init.lua
32
init.lua
|
@ -1,19 +1,25 @@
|
||||||
require("options")
|
|
||||||
require("keymaps")
|
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable", -- latest stable release
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup({ { import = "plugins" }, { import = "plugins.lsp" }, { import = "plugins.themes" } })
|
require("options")
|
||||||
|
require("keymaps")
|
||||||
|
require("lazy").setup("plugins")
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
vim.cmd "colorscheme rose-pine"
|
||||||
|
|
||||||
vim.cmd("colorscheme rose-pine")
|
require('Comment').setup()
|
||||||
|
require("setup/lualine")
|
||||||
|
require("setup/bufferline")
|
||||||
|
require("setup/nvim-cmp")
|
||||||
|
require("setup/lsp")
|
||||||
|
require("setup/toggle-diagnostics")
|
||||||
|
|
|
@ -17,49 +17,49 @@ map("n", "<leader>d", ":ToggleDiag<cr>") -- toggle all diagnostics
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
-- desc = 'LSP actions',
|
desc = 'LSP actions',
|
||||||
-- callback = function()
|
callback = function()
|
||||||
-- local bufmap = function(mode, lhs, rhs)
|
local bufmap = function(mode, lhs, rhs)
|
||||||
-- local opts = {buffer = true}
|
local opts = {buffer = true}
|
||||||
-- vim.keymap.set(mode, lhs, rhs, opts)
|
vim.keymap.set(mode, lhs, rhs, opts)
|
||||||
-- end
|
end
|
||||||
--
|
|
||||||
-- -- Displays hover information about the symbol under the cursor
|
-- Displays hover information about the symbol under the cursor
|
||||||
-- bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||||
--
|
|
||||||
-- -- Jump to the definition
|
-- Jump to the definition
|
||||||
-- bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||||
--
|
|
||||||
-- -- Jump to declaration
|
-- Jump to declaration
|
||||||
-- bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||||
--
|
|
||||||
-- -- Lists all the implementations for the symbol under the cursor
|
-- Lists all the implementations for the symbol under the cursor
|
||||||
-- bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
|
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
|
||||||
--
|
|
||||||
-- -- Jumps to the definition of the type symbol
|
-- Jumps to the definition of the type symbol
|
||||||
-- bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||||
--
|
|
||||||
-- -- Lists all the references
|
-- Lists all the references
|
||||||
-- bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
|
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
|
||||||
--
|
|
||||||
-- -- Displays a function's signature information
|
-- Displays a function's signature information
|
||||||
-- bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||||
--
|
|
||||||
-- -- Renames all references to the symbol under the cursor
|
-- Renames all references to the symbol under the cursor
|
||||||
-- bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||||
--
|
|
||||||
-- -- Selects a code action available at the current cursor position
|
-- Selects a code action available at the current cursor position
|
||||||
-- bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||||
--
|
|
||||||
-- -- Show diagnostics in a floating window
|
-- Show diagnostics in a floating window
|
||||||
-- bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||||
--
|
|
||||||
-- -- Move to the previous diagnostic
|
-- Move to the previous diagnostic
|
||||||
-- bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||||
--
|
|
||||||
-- -- Move to the next diagnostic
|
-- Move to the next diagnostic
|
||||||
-- bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||||
-- end
|
end
|
||||||
-- })
|
})
|
||||||
--
|
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
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"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
return {
|
|
||||||
"akinsho/bufferline.nvim",
|
|
||||||
version = "*",
|
|
||||||
dependencies = "nvim-tree/nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require("bufferline").setup({})
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
return {'numToStr/Comment.nvim',
|
|
||||||
opts = {
|
|
||||||
-- add any options here
|
|
||||||
},
|
|
||||||
lazy = false,
|
|
||||||
}
|
|
|
@ -1,106 +0,0 @@
|
||||||
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,
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
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,
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"kdheepak/lazygit.nvim",
|
|
||||||
cmd = {
|
|
||||||
"LazyGit",
|
|
||||||
"LazyGitConfig",
|
|
||||||
"LazyGitCurrentFile",
|
|
||||||
"LazyGitFilter",
|
|
||||||
"LazyGitFilterCurrentFile",
|
|
||||||
},
|
|
||||||
-- optional for floating window border decoration
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
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,41 +0,0 @@
|
||||||
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
|
|
||||||
-- }
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
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,
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
return { "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...}
|
|
|
@ -1,2 +0,0 @@
|
||||||
|
|
||||||
return {"rose-pine/neovim", name = "rose-pine"}
|
|
|
@ -1,3 +0,0 @@
|
||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter"
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
return {"folke/twilight.nvim", opts = {context = 1}}
|
|
|
@ -1 +0,0 @@
|
||||||
return {"preservim/vim-pencil"}
|
|
|
@ -1,12 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
return {"folke/zen-mode.nvim",
|
|
||||||
opts = {
|
|
||||||
window = {width = 60}}
|
|
||||||
}
|
|
|
@ -0,0 +1 @@
|
||||||
|
require("bufferline").setup{}
|
|
@ -1,8 +1,9 @@
|
||||||
return {"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
|
|
||||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
|
require("mason").setup()
|
||||||
|
require("mason-lspconfig").setup {
|
||||||
|
-- ensure_installed = { "lua_ls", "grammarly", "ltex" },
|
||||||
|
}
|
||||||
lspconfig.lua_ls.setup {
|
lspconfig.lua_ls.setup {
|
||||||
capabilities = lsp_capabilities,
|
capabilities = lsp_capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -25,11 +26,7 @@ lspconfig.lua_ls.setup {
|
||||||
-- root_dir = function(fname)
|
-- root_dir = function(fname)
|
||||||
-- return require'lspconfig'.util.find_git_ancestor(fname) or vim.loop.os_homedir()
|
-- return require'lspconfig'.util.find_git_ancestor(fname) or vim.loop.os_homedir()
|
||||||
-- end,
|
-- end,
|
||||||
-- }
|
-- }
|
||||||
-- lspconfig.marksman.setup {
|
-- require("lspconfig").marksman.setup {
|
||||||
-- capabilities = lsp_capabilities,
|
-- capabilities = lsp_capabilities,
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
local function getWords()
|
||||||
|
return tostring(vim.fn.wordcount().words)
|
||||||
|
end
|
||||||
|
require('lualine').setup {
|
||||||
|
sections = {
|
||||||
|
lualine_z = { getWords },
|
||||||
|
},
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
require("neo-tree").setup({})
|
|
@ -0,0 +1,85 @@
|
||||||
|
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'}),
|
||||||
|
},
|
||||||
|
})
|
|
@ -0,0 +1,9 @@
|
||||||
|
require('lint').linters_by_ft = {
|
||||||
|
markdown = {'proselint',}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
|
callback = function()
|
||||||
|
require("lint").try_lint()
|
||||||
|
end,
|
||||||
|
})
|
|
@ -0,0 +1,3 @@
|
||||||
|
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