feat: replace some plugins
This commit is contained in:
parent
c756bf993f
commit
7ec4c850d3
@ -2,6 +2,7 @@
|
|||||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||||
"Lua.diagnostics.globals": [
|
"Lua.diagnostics.globals": [
|
||||||
"require",
|
"require",
|
||||||
"vim"
|
"vim",
|
||||||
|
"pcall"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -30,7 +30,7 @@ bind -Tcopy-mode WheelDownPane send -N1 -X scroll-down
|
|||||||
set -g mode-keys vi
|
set -g mode-keys vi
|
||||||
|
|
||||||
# Enable mouse mode (tmux 2.1 and above)
|
# Enable mouse mode (tmux 2.1 and above)
|
||||||
set -g mouse on
|
set -g mouse off
|
||||||
|
|
||||||
bind h select-pane -L
|
bind h select-pane -L
|
||||||
bind j select-pane -D
|
bind j select-pane -D
|
||||||
|
@ -7,7 +7,7 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ZSH_THEME="powerlevel10k/powerlevel10k"
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
||||||
ZSH_TMUX_AUTOSTART=true
|
# ZSH_TMUX_AUTOSTART=true
|
||||||
ZSH_TMUX_AUTOCONNECT=false
|
ZSH_TMUX_AUTOCONNECT=false
|
||||||
|
|
||||||
plugins=(
|
plugins=(
|
||||||
@ -89,7 +89,7 @@ fi
|
|||||||
|
|
||||||
# Auto connect to tmux session of ssh
|
# Auto connect to tmux session of ssh
|
||||||
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
||||||
tmux attach-session -t $USER || tmux new-session -s $USER
|
# tmux attach-session -t $USER || tmux new-session -s $USER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PNPM_HOME="$HOME/.local/share/pnpm"
|
export PNPM_HOME="$HOME/.local/share/pnpm"
|
||||||
|
@ -3,27 +3,33 @@ if has_impatient then
|
|||||||
impatient.enable_profile()
|
impatient.enable_profile()
|
||||||
end
|
end
|
||||||
|
|
||||||
require "core.plugins"
|
require("core.plugins")
|
||||||
|
|
||||||
local status_ok = pcall(require, "nightfox")
|
local status_ok = pcall(require, "nightfox")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require("hologram").setup({
|
||||||
|
auto_display = true, -- WIP automatic markdown image display, may be prone to breaking
|
||||||
|
})
|
||||||
|
|
||||||
require "core.options"
|
-- Require and call setup function somewhere in your init.lua
|
||||||
require "core.autocommands"
|
|
||||||
require "core.theme"
|
|
||||||
require "core.keymappings"
|
|
||||||
|
|
||||||
require "configs.dashboard"
|
require("core.options")
|
||||||
require "configs.command-center"
|
require("core.autocommands")
|
||||||
require "configs.notify"
|
require("core.theme")
|
||||||
require "configs.lsp"
|
require("core.keymappings")
|
||||||
require "configs.telescope"
|
|
||||||
require "configs.tree"
|
|
||||||
require "configs.treesitter"
|
|
||||||
require "configs.autocomplete"
|
|
||||||
require "configs.snippets"
|
|
||||||
|
|
||||||
require "overlays"
|
require("configs.dashboard")
|
||||||
|
require("configs.dap")
|
||||||
|
require("configs.command-center")
|
||||||
|
require("configs.notify")
|
||||||
|
require("configs.lsp")
|
||||||
|
require("configs.telescope")
|
||||||
|
require("configs.tree")
|
||||||
|
require("configs.treesitter")
|
||||||
|
require("configs.autocomplete")
|
||||||
|
require("configs.snippets")
|
||||||
|
|
||||||
|
require("overlays")
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
-- luasnip setup
|
-- luasnip setup
|
||||||
local luasnip = require "luasnip"
|
local luasnip = require("luasnip")
|
||||||
local lspkind = require "lspkind"
|
local lspkind = require("lspkind")
|
||||||
local cmp = require "cmp"
|
local cmp = require("cmp")
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
local compare = require('cmp.config.compare')
|
local compare = require("cmp.config.compare")
|
||||||
|
local cmp_buffer = require("cmp_buffer")
|
||||||
|
local tabnine = require("cmp_tabnine.config")
|
||||||
|
|
||||||
local source_mapping = {
|
local source_mapping = {
|
||||||
buffer = "[Buffer]",
|
buffer = "[Buffer]",
|
||||||
@ -13,62 +15,41 @@ local source_mapping = {
|
|||||||
path = "[Path]",
|
path = "[Path]",
|
||||||
}
|
}
|
||||||
|
|
||||||
local tabnine = require('cmp_tabnine.config')
|
|
||||||
tabnine:setup({
|
tabnine:setup({
|
||||||
max_lines = 1000;
|
max_lines = 1000,
|
||||||
max_num_results = 20;
|
max_num_results = 20,
|
||||||
sort = true;
|
sort = true,
|
||||||
run_on_every_keystroke = true;
|
run_on_every_keystroke = true,
|
||||||
snippet_placeholder = '..';
|
snippet_placeholder = "..",
|
||||||
ignored_file_types = { -- default is not to ignore
|
ignored_file_types = { -- default is not to ignore
|
||||||
-- uncomment to ignore in lua:
|
-- uncomment to ignore in lua:
|
||||||
-- lua = true
|
-- lua = true
|
||||||
};
|
},
|
||||||
show_prediction_strength = false;
|
show_prediction_strength = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup({
|
||||||
-- formatting = {
|
|
||||||
-- format = lspkind.cmp_format(
|
|
||||||
-- {
|
|
||||||
-- with_text = true,
|
|
||||||
-- menu = ({
|
|
||||||
-- buffer = "[Buffer]",
|
|
||||||
-- nvim_lsp = "[LSP]",
|
|
||||||
-- luasnip = "[LuaSnip]",
|
|
||||||
-- nvim_lua = "[Lua]",
|
|
||||||
-- latex_symbols = "[Latex]"
|
|
||||||
-- })
|
|
||||||
-- }
|
|
||||||
-- )
|
|
||||||
-- },
|
|
||||||
sorting = {
|
sorting = {
|
||||||
priority_weight = 2,
|
|
||||||
comparators = {
|
comparators = {
|
||||||
require('cmp_tabnine.compare'),
|
|
||||||
compare.offset,
|
|
||||||
compare.exact,
|
|
||||||
compare.score,
|
compare.score,
|
||||||
compare.recently_used,
|
compare.recently_used,
|
||||||
compare.kind,
|
compare.kind,
|
||||||
compare.sort_text,
|
compare.offset,
|
||||||
compare.length,
|
|
||||||
compare.order,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
experimental = {
|
experimental = {
|
||||||
ghost_text = true
|
ghost_text = true,
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,menuone"
|
completeopt = "menu,menuone",
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-Leader>"] = cmp.mapping.complete(),
|
["<C-Leader>"] = cmp.mapping.complete({}),
|
||||||
["<Tab>"] = function(fallback)
|
["<Tab>"] = function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
@ -83,68 +64,58 @@ cmp.setup {
|
|||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
["<CR>"] = cmp.mapping.confirm(
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
{
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true
|
select = true,
|
||||||
}
|
}),
|
||||||
)
|
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
vim_item.kind = lspkind.presets.default[vim_item.kind]
|
vim_item.kind = lspkind.presets.default[vim_item.kind]
|
||||||
local menu = source_mapping[entry.source.name]
|
local menu = source_mapping[entry.source.name]
|
||||||
if entry.source.name == 'cmp_tabnine' then
|
if entry.source.name == "cmp_tabnine" then
|
||||||
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
|
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
|
||||||
menu = entry.completion_item.data.detail .. ' ' .. menu
|
menu = entry.completion_item.data.detail .. " " .. menu
|
||||||
end
|
end
|
||||||
vim_item.kind = ''
|
vim_item.kind = ""
|
||||||
end
|
end
|
||||||
vim_item.menu = menu
|
vim_item.menu = menu
|
||||||
return vim_item
|
return vim_item
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lua" },
|
{ name = "nvim_lua" },
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "cmp_tabnine" },
|
{ name = "cmp_tabnine", max_item_count = 3 },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer", max_item_count = 3 },
|
||||||
{ name = "calc" }
|
{ name = "calc" },
|
||||||
}
|
-- { name = 'copilot' }
|
||||||
}
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||||
cmp.setup.cmdline(
|
cmp.setup.cmdline("/", {
|
||||||
"/",
|
|
||||||
{
|
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "buffer" }
|
{ name = "buffer" },
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
cmp.setup.cmdline(
|
cmp.setup.cmdline(":", {
|
||||||
":",
|
sources = cmp.config.sources({
|
||||||
{
|
{ name = "path" },
|
||||||
sources = cmp.config.sources(
|
}, {
|
||||||
{
|
{ name = "cmdline" },
|
||||||
{ name = "path" }
|
}),
|
||||||
},
|
})
|
||||||
{
|
|
||||||
{ name = "cmdline" }
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
|
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
|
||||||
-- Setup lspconfig.
|
-- Setup lspconfig.
|
||||||
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
require "lspconfig".html.setup {
|
require("lspconfig").html.setup({
|
||||||
capabilities = capabilities
|
capabilities = capabilities,
|
||||||
}
|
})
|
||||||
|
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
||||||
|
34
configs/nvim/lua/configs/dap.lua
Normal file
34
configs/nvim/lua/configs/dap.lua
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
local dap, dapui = require("dap"), require("dapui")
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.adapters.firefox = {
|
||||||
|
type = "executable",
|
||||||
|
command = "node",
|
||||||
|
options = {
|
||||||
|
initialize_timeout_sec = 10,
|
||||||
|
disconnect_timeout_sec = 10,
|
||||||
|
max_retries = 30,
|
||||||
|
},
|
||||||
|
args = { os.getenv("HOME") .. "/.local/share/nvim/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js" },
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.typescript = {
|
||||||
|
{
|
||||||
|
name = "Debug with Firefox",
|
||||||
|
type = "firefox",
|
||||||
|
request = "launch",
|
||||||
|
reAttach = true,
|
||||||
|
webRoot = "${workspaceFolder}",
|
||||||
|
url = "http://localhost:8080",
|
||||||
|
firefoxExecutable = "/sbin/firefox-developer-edition",
|
||||||
|
},
|
||||||
|
}
|
@ -1,8 +1,20 @@
|
|||||||
local lsp_installer = require("nvim-lsp-installer")
|
local mason = require("mason")
|
||||||
lsp_installer.setup {
|
local mason_lsp = require("mason-lspconfig")
|
||||||
ensure_installed = { "sumneko_lua", "jsonls", "tsserver", "svelte", "cssls" }
|
local lsp = require("lspconfig")
|
||||||
}
|
|
||||||
local lsp = require "lspconfig"
|
require("null-ls").setup({
|
||||||
|
sources = {
|
||||||
|
require("null-ls").builtins.formatting.stylua,
|
||||||
|
require("null-ls").builtins.diagnostics.eslint,
|
||||||
|
require("null-ls").builtins.completion.spell,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
mason.setup()
|
||||||
|
|
||||||
|
mason_lsp.setup({
|
||||||
|
ensure_installed = { "sumneko_lua", "jsonls", "tsserver", "svelte", "cssls" },
|
||||||
|
})
|
||||||
|
|
||||||
local runtime_path = vim.split(package.path, ";")
|
local runtime_path = vim.split(package.path, ";")
|
||||||
table.insert(runtime_path, "lua/?.lua")
|
table.insert(runtime_path, "lua/?.lua")
|
||||||
@ -11,35 +23,32 @@ table.insert(runtime_path, "lua/?/init.lua")
|
|||||||
local function on_attach(client, bufnr)
|
local function on_attach(client, bufnr)
|
||||||
local cap = client.server_capabilities
|
local cap = client.server_capabilities
|
||||||
|
|
||||||
if (cap.documentFormattingProvider) then
|
if cap.documentFormattingProvider then
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function()
|
callback = function()
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
|
||||||
vim.lsp.buf.format();
|
if client.name == "tsserver" or client.name == "svelte" then
|
||||||
|
|
||||||
if client.name == 'tsserver' or client.name == "svelte" then
|
|
||||||
-- params for the request
|
-- params for the request
|
||||||
local params = {
|
local params = {
|
||||||
command = "_typescript.organizeImports",
|
command = "_typescript.organizeImports",
|
||||||
arguments = { vim.api.nvim_buf_get_name(bufnr) },
|
arguments = { vim.api.nvim_buf_get_name(bufnr) },
|
||||||
title = ""
|
title = "",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- perform a syncronous request
|
-- perform a syncronous request
|
||||||
-- 500ms timeout depending on the size of file a bigger timeout may be needed
|
-- 500ms timeout depending on the size of file a bigger timeout may be needed
|
||||||
vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500)
|
vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500)
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
vim.notify("Lsp (" .. client.name .. ") doesnt support format")
|
-- vim.notify("Lsp (" .. client.name .. ") doesnt support format")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp.sumneko_lua.setup {
|
lsp.sumneko_lua.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
@ -47,101 +56,118 @@ lsp.sumneko_lua.setup {
|
|||||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
version = "LuaJIT",
|
version = "LuaJIT",
|
||||||
-- Setup your lua path
|
-- Setup your lua path
|
||||||
path = runtime_path
|
path = runtime_path,
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
-- Get the language server to recognize the `vim` global
|
-- Get the language server to recognize the `vim` global
|
||||||
globals = { "vim" }
|
globals = { "vim" },
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
-- Make the server aware of Neovim runtime files
|
-- Make the server aware of Neovim runtime files
|
||||||
library = vim.api.nvim_get_runtime_file("", true)
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
},
|
},
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
telemetry = {
|
telemetry = {
|
||||||
enable = false
|
enable = false,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
|
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
lsp.solargraph.setup {
|
lsp.prismals.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.solargraph.setup({
|
||||||
filetypes = { "ruby" },
|
filetypes = { "ruby" },
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
}
|
})
|
||||||
|
|
||||||
lsp.jsonls.setup {
|
lsp.elixirls.setup({
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.jsonls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
json = {
|
json = {
|
||||||
schemas = {
|
schemas = {
|
||||||
{
|
{
|
||||||
description = 'TypeScript compiler configuration file',
|
description = "TypeScript compiler configuration file",
|
||||||
fileMatch = { 'tsconfig.json', 'tsconfig.*.json' },
|
fileMatch = { "tsconfig.json", "tsconfig.*.json" },
|
||||||
url = 'http://json.schemastore.org/tsconfig'
|
url = "http://json.schemastore.org/tsconfig",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description = 'ESLint config',
|
description = "ESLint config",
|
||||||
fileMatch = { '.eslintrc.json', '.eslintrc' },
|
fileMatch = { ".eslintrc.json", ".eslintrc" },
|
||||||
url = 'http://json.schemastore.org/eslintrc'
|
url = "http://json.schemastore.org/eslintrc",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description = 'Prettier config',
|
description = "Prettier config",
|
||||||
fileMatch = { '.prettierrc', '.prettierrc.json', 'prettier.config.json' },
|
fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" },
|
||||||
url = 'http://json.schemastore.org/prettierrc'
|
url = "http://json.schemastore.org/prettierrc",
|
||||||
},
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
})
|
||||||
|
|
||||||
lsp.svelte.setup {
|
lsp.svelte.setup({
|
||||||
on_attach = on_attach
|
capabilities = capabilities,
|
||||||
}
|
on_attach = on_attach,
|
||||||
lsp.tsserver.setup {
|
})
|
||||||
on_attach = on_attach
|
lsp.tsserver.setup({
|
||||||
}
|
capabilities = capabilities,
|
||||||
lsp.html.setup {
|
on_attach = on_attach,
|
||||||
on_attach = on_attach
|
})
|
||||||
}
|
lsp.html.setup({
|
||||||
lsp.intelephense.setup {
|
capabilities = capabilities,
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
}
|
})
|
||||||
lsp.cssls.setup {
|
lsp.intelephense.setup({
|
||||||
on_attach = on_attach
|
capabilities = capabilities,
|
||||||
}
|
on_attach = on_attach,
|
||||||
lsp.zls.setup {
|
})
|
||||||
on_attach = on_attach
|
lsp.cssls.setup({
|
||||||
}
|
capabilities = capabilities,
|
||||||
lsp.bashls.setup {
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
lsp.zls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
lsp.bashls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
filetypes = { "sh", "bash" },
|
filetypes = { "sh", "bash" },
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
}
|
})
|
||||||
|
|
||||||
-- lsp.remark_ls.setup {
|
-- lsp.remark_ls.setup {
|
||||||
-- filetypes = { "markdown" },
|
-- filetypes = { "markdown" },
|
||||||
-- on_attach = on_attach
|
-- on_attach = on_attach
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
lsp.ltex.setup {
|
lsp.ltex.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
cmd = { os.getenv("HOME") .. '/.local/share/nvim/lsp_servers/ltex/ltex-ls/bin/ltex-ls' },
|
cmd = { os.getenv("HOME") .. "/.local/share/nvim/lsp_servers/ltex/ltex-ls/bin/ltex-ls" },
|
||||||
settings = {
|
settings = {
|
||||||
ltex = {
|
ltex = {
|
||||||
disabledRules = { ['en-US'] = { 'PROFANITY' } },
|
disabledRules = { ["en-US"] = { "PROFANITY" } },
|
||||||
dictionary = {
|
dictionary = {
|
||||||
['en-US'] = { 'perf', 'ci', 'neovim' },
|
["en-US"] = { "perf", "ci", "neovim" },
|
||||||
},
|
},
|
||||||
hiddenFalsePositives = {
|
hiddenFalsePositives = {
|
||||||
'neovim',
|
"neovim",
|
||||||
'Neovim',
|
"Neovim",
|
||||||
'waybar'
|
"waybar",
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
})
|
||||||
|
@ -24,6 +24,9 @@ map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", options)
|
|||||||
map("n", "<Leader>c", "<cmd>lua vim.lsp.buf.code_action()<CR>", options)
|
map("n", "<Leader>c", "<cmd>lua vim.lsp.buf.code_action()<CR>", options)
|
||||||
map("n", "<leader>t", ":TroubleToggle<CR>", remap)
|
map("n", "<leader>t", ":TroubleToggle<CR>", remap)
|
||||||
|
|
||||||
|
-- DAP Functionality
|
||||||
|
map("n", "<Leader>b", ":lua require('dap').toggle_breakpoint()", options)
|
||||||
|
|
||||||
-- Navigate Buffers
|
-- Navigate Buffers
|
||||||
map("n", "<C-h>", "<C-w>h", options)
|
map("n", "<C-h>", "<C-w>h", options)
|
||||||
map("n", "<C-j>", "<C-w>j", options)
|
map("n", "<C-j>", "<C-w>j", options)
|
||||||
@ -41,11 +44,11 @@ map("n", "<C-w>h", ":sp<CR>", remap) -- horizontal
|
|||||||
map("n", "<C-w>v", ":vs<CR>", remap) -- vertical
|
map("n", "<C-w>v", ":vs<CR>", remap) -- vertical
|
||||||
|
|
||||||
-- Browser like next/previous
|
-- Browser like next/previous
|
||||||
map("n", "<A-Left>", ":bprevious<CR>", options);
|
map("n", "<A-Left>", ":bprevious<CR>", options)
|
||||||
map("n", "<A-Right>", ":bnext<CR>", options);
|
map("n", "<A-Right>", ":bnext<CR>", options)
|
||||||
|
|
||||||
-- Backspace Delete like Browser
|
-- Backspace Delete like Browser
|
||||||
map('i', '<C-H>', '<Esc>dbxi', options)
|
map("i", "<C-H>", "<Esc>dbxi", options)
|
||||||
|
|
||||||
-- Copy visual selection to keyboard
|
-- Copy visual selection to keyboard
|
||||||
map("v", "Y", '"+y', options)
|
map("v", "Y", '"+y', options)
|
||||||
@ -76,8 +79,8 @@ map("n", "<Leader>gdh", ":diffget //2<CR>", options)
|
|||||||
-- Find file in NvimTree
|
-- Find file in NvimTree
|
||||||
map("n", "<Leader>f", ":NvimTreeFindFile<CR><c-w>", options)
|
map("n", "<Leader>f", ":NvimTreeFindFile<CR><c-w>", options)
|
||||||
|
|
||||||
map("n", "<C-->", ":vsplit<CR>", options);
|
map("n", "<C-->", ":vsplit<CR>", options)
|
||||||
map("n", "<C-|>", ":split<CR>", options);
|
map("n", "<C-|>", ":split<CR>", options)
|
||||||
|
|
||||||
-- I aint no weak boy
|
-- I aint no weak boy
|
||||||
map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", options)
|
map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", options)
|
||||||
|
@ -15,14 +15,14 @@ set.autoindent = true -- Good auto indent
|
|||||||
set.autochdir = false -- Your working directory will always be the same as your working directory
|
set.autochdir = false -- Your working directory will always be the same as your working directory
|
||||||
set.incsearch = true -- sets incremental search
|
set.incsearch = true -- sets incremental search
|
||||||
set.shell = "/bin/zsh" -- Set your shell to bash or zsh
|
set.shell = "/bin/zsh" -- Set your shell to bash or zsh
|
||||||
set.shortmess:append "sI" -- Disable nvim intro
|
set.shortmess:append("sI") -- Disable nvim intro
|
||||||
vim.cmd [[set nobackup]] -- creates a backup file
|
vim.cmd([[set nobackup]]) -- creates a backup file
|
||||||
vim.cmd [[set nowritebackup]] -- creates a backup file i guess
|
vim.cmd([[set nowritebackup]]) -- creates a backup file i guess
|
||||||
vim.cmd [[set formatoptions-=cro]] -- Stop newline continution of comments
|
vim.cmd([[set formatoptions-=cro]]) -- Stop newline continution of comments
|
||||||
vim.cmd [[set complete+=kspell]] -- auto complete with spellcheck
|
vim.cmd([[set complete+=kspell]]) -- auto complete with spellcheck
|
||||||
vim.cmd [[set completeopt=menuone,longest]] -- auto complete menu (It's pretty great)
|
vim.cmd([[set completeopt=menuone,longest]]) -- auto complete menu (It's pretty great)
|
||||||
vim.cmd [[set nocompatible]] -- Disable compatibility to old-time vi
|
vim.cmd([[set nocompatible]]) -- Disable compatibility to old-time vi
|
||||||
set.mouse = 'a' -- Enable mouse support
|
set.mouse = "a" -- Enable mouse support
|
||||||
set.foldmethod = "expr"
|
set.foldmethod = "expr"
|
||||||
set.foldexpr = "nvim_treesitter#foldexpr()" -- use treesitter for folding
|
set.foldexpr = "nvim_treesitter#foldexpr()" -- use treesitter for folding
|
||||||
vim.wo.foldlevel = 99 -- feel free to decrease the value
|
vim.wo.foldlevel = 99 -- feel free to decrease the value
|
||||||
@ -50,11 +50,14 @@ set.cursorline = false -- Enable highlighting of the current line
|
|||||||
set.shiftwidth = 2 -- Change the number of space characters inserted for indentation
|
set.shiftwidth = 2 -- Change the number of space characters inserted for indentation
|
||||||
set.showtabline = 1 -- Always show tabs
|
set.showtabline = 1 -- Always show tabs
|
||||||
set.cmdheight = 1 -- More space for displaying messages
|
set.cmdheight = 1 -- More space for displaying messages
|
||||||
vim.cmd [[set nowrap]] -- Display long lines as just one line
|
vim.cmd([[set nowrap]]) -- Display long lines as just one line
|
||||||
vim.cmd [[set noshowmode]] -- We don't need to see things like -- INSERT -- anymore
|
vim.cmd([[set noshowmode]]) -- We don't need to see things like -- INSERT -- anymore
|
||||||
vim.cmd [[syntax enable]] -- Enables syntax highlighing
|
vim.cmd([[syntax enable]]) -- Enables syntax highlighing
|
||||||
vim.cmd [[set t_Co=256]] -- Support 256 colors
|
vim.cmd([[set t_Co=256]]) -- Support 256 colors
|
||||||
-- vim.cmd "set whichwrap+=<,>,[,],h,l" -- Breaks Space-Time Continuum
|
-- vim.cmd "set whichwrap+=<,>,[,],h,l" -- Breaks Space-Time Continuum
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
})
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
-- Memory, CPU --
|
-- Memory, CPU --
|
||||||
|
@ -1,103 +1,136 @@
|
|||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
local packer_bootstrap = false
|
local packer_bootstrap = false
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
packer_bootstrap = fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim',
|
packer_bootstrap =
|
||||||
install_path })
|
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
|
||||||
vim.cmd 'packadd packer.nvim'
|
vim.cmd("packadd packer.nvim")
|
||||||
end
|
end
|
||||||
|
|
||||||
local packer = require("packer")
|
local packer = require("packer")
|
||||||
packer.init {
|
packer.init({
|
||||||
display = {
|
display = {
|
||||||
open_fn = function()
|
open_fn = function()
|
||||||
return require("packer.util").float { border = "rounded" }
|
return require("packer.util").float({ border = "rounded" })
|
||||||
end,
|
end,
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
return packer.startup(function(use)
|
return packer.startup(function(use)
|
||||||
-- Let packer manage itself
|
-- Let packer manage itself
|
||||||
use "wbthomason/packer.nvim"
|
use("wbthomason/packer.nvim")
|
||||||
use 'lewis6991/impatient.nvim'
|
use("lewis6991/impatient.nvim")
|
||||||
|
|
||||||
-- General Helper Functions
|
-- General Helper Functions
|
||||||
use "nvim-lua/plenary.nvim"
|
use("nvim-lua/plenary.nvim")
|
||||||
|
|
||||||
-- Theming Section
|
-- Theming Section
|
||||||
use "rktjmp/fwatch.nvim" -- Used to check dark/light theme
|
use("rktjmp/fwatch.nvim") -- Used to check dark/light theme
|
||||||
use "EdenEast/nightfox.nvim"
|
use("EdenEast/nightfox.nvim")
|
||||||
use "nvim-lualine/lualine.nvim"
|
use("nvim-lualine/lualine.nvim")
|
||||||
|
|
||||||
-- Layout Plugins
|
-- Layout Plugins
|
||||||
use "dstein64/nvim-scrollview" -- ScrollBars
|
use("dstein64/nvim-scrollview") -- ScrollBars
|
||||||
use "akinsho/nvim-toggleterm.lua"
|
use("akinsho/nvim-toggleterm.lua")
|
||||||
use { "folke/zen-mode.nvim", config = function() require("zen-mode").setup {} end }
|
use({
|
||||||
use "rcarriga/nvim-notify"
|
"folke/zen-mode.nvim",
|
||||||
use "kyazdani42/nvim-web-devicons"
|
config = function()
|
||||||
use "kyazdani42/nvim-tree.lua"
|
require("zen-mode").setup({})
|
||||||
use "nvim-lua/popup.nvim"
|
end,
|
||||||
use 'goolord/alpha-nvim'
|
})
|
||||||
use { "terrortylor/nvim-comment", config = function() require('nvim_comment').setup() end }
|
use("rcarriga/nvim-notify")
|
||||||
use { "windwp/nvim-autopairs", config = function() require('nvim-autopairs').setup() end }
|
use("kyazdani42/nvim-web-devicons")
|
||||||
use "gfeiyou/command-center.nvim"
|
use("kyazdani42/nvim-tree.lua")
|
||||||
|
use("nvim-lua/popup.nvim")
|
||||||
|
use("goolord/alpha-nvim")
|
||||||
|
use({
|
||||||
|
"terrortylor/nvim-comment",
|
||||||
|
config = function()
|
||||||
|
require("nvim_comment").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function()
|
||||||
|
require("nvim-autopairs").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use("gfeiyou/command-center.nvim")
|
||||||
|
|
||||||
-- Code Navigation
|
-- Code Navigation
|
||||||
use "junegunn/fzf"
|
use("junegunn/fzf")
|
||||||
use "nvim-telescope/telescope.nvim"
|
use("nvim-telescope/telescope.nvim")
|
||||||
|
|
||||||
-- Lsp Errors
|
-- Lsp Errors
|
||||||
use "folke/lsp-colors.nvim"
|
use("folke/lsp-colors.nvim")
|
||||||
use "kosayoda/nvim-lightbulb"
|
use("kosayoda/nvim-lightbulb")
|
||||||
use {
|
use({
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
config = function()
|
config = function()
|
||||||
require("trouble").setup {}
|
require("trouble").setup({})
|
||||||
end
|
end,
|
||||||
}
|
})
|
||||||
|
use({
|
||||||
|
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||||
|
config = function()
|
||||||
|
require("lsp_lines").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Syntax / Autocomplete
|
-- Syntax / Autocomplete
|
||||||
use "tpope/vim-surround"
|
use("tpope/vim-surround")
|
||||||
use "neovim/nvim-lspconfig"
|
use("neovim/nvim-lspconfig")
|
||||||
use "hrsh7th/nvim-cmp"
|
use("hrsh7th/nvim-cmp")
|
||||||
use "onsails/lspkind.nvim"
|
use("onsails/lspkind.nvim")
|
||||||
use { 'tzachar/cmp-tabnine', run = './install.sh', requires = 'hrsh7th/nvim-cmp' }
|
use({ "tzachar/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp" })
|
||||||
use "hrsh7th/cmp-nvim-lsp"
|
-- use({ "hrsh7th/cmp-copilot", requires = "github/copilot.vim" })
|
||||||
use "hrsh7th/cmp-path"
|
use("hrsh7th/cmp-nvim-lsp")
|
||||||
use "hrsh7th/cmp-calc"
|
use("hrsh7th/cmp-path")
|
||||||
use "hrsh7th/cmp-buffer"
|
use("hrsh7th/cmp-calc")
|
||||||
use "hrsh7th/cmp-cmdline"
|
use("hrsh7th/cmp-buffer")
|
||||||
use "rafamadriz/friendly-snippets"
|
use("hrsh7th/cmp-cmdline")
|
||||||
use "L3MON4D3/LuaSnip"
|
use("rafamadriz/friendly-snippets")
|
||||||
use "saadparwaiz1/cmp_luasnip"
|
use("L3MON4D3/LuaSnip")
|
||||||
use "williamboman/nvim-lsp-installer"
|
use("saadparwaiz1/cmp_luasnip")
|
||||||
use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }
|
|
||||||
|
use({ "williamboman/mason.nvim" })
|
||||||
|
use({ "williamboman/mason-lspconfig.nvim" })
|
||||||
|
use({ "jose-elias-alvarez/null-ls.nvim" })
|
||||||
|
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
|
||||||
|
|
||||||
|
-- Dap Debugger
|
||||||
|
use({ "mfussenegger/nvim-dap" })
|
||||||
|
use({ "rcarriga/nvim-dap-ui" })
|
||||||
|
|
||||||
-- More IDE like features
|
-- More IDE like features
|
||||||
use {
|
use({
|
||||||
'rmagatti/session-lens',
|
"rmagatti/session-lens",
|
||||||
requires = { 'rmagatti/auto-session', 'nvim-telescope/telescope.nvim' },
|
requires = { "rmagatti/auto-session", "nvim-telescope/telescope.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
require('session-lens').setup({ path_display = { 'shorten' } })
|
require("session-lens").setup({ path_display = { "shorten" } })
|
||||||
end
|
end,
|
||||||
}
|
})
|
||||||
|
|
||||||
use {
|
use({
|
||||||
|
"edluffy/hologram.nvim",
|
||||||
|
config = function() end,
|
||||||
|
})
|
||||||
|
|
||||||
|
use({
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
requires = {
|
requires = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
"antoinemadec/FixCursorHold.nvim"
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
-- Database Feature
|
-- Database Feature
|
||||||
use "tpope/vim-dadbod"
|
use("tpope/vim-dadbod")
|
||||||
use "kristijanhusak/vim-dadbod-ui"
|
use("kristijanhusak/vim-dadbod-ui")
|
||||||
|
|
||||||
if packer_bootstrap then
|
if packer_bootstrap then
|
||||||
packer.sync()
|
packer.sync()
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
10
configs/wezterm/wezterm.lua
Normal file
10
configs/wezterm/wezterm.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
local wezterm = require("wezterm")
|
||||||
|
|
||||||
|
return {
|
||||||
|
font = wezterm.font("FiraCodeNerdFont"),
|
||||||
|
font_size = 13,
|
||||||
|
-- You can specify some parameters to influence the font selection;
|
||||||
|
-- for example, this selects a Bold, Italic font variant.
|
||||||
|
use_fancy_tab_bar = false,
|
||||||
|
hide_tab_bar_if_only_one_tab = true,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user