dotfiles with stow
This commit is contained in:
14
config/.config/nvim/after/plugin/colors.lua
Executable file
14
config/.config/nvim/after/plugin/colors.lua
Executable file
@@ -0,0 +1,14 @@
|
||||
function colors(color)
|
||||
color = color or 'vscode'
|
||||
-- Available values: `'hard'`, `'medium'`, `'soft'`
|
||||
vim.g.gruvbox_material_background = 'medium'
|
||||
-- Available values: `'material'`, `'mix'`, `'original'`
|
||||
vim.g.gruvbox_material_foreground = 'mix'
|
||||
-- Available values: `'hard'`, `'medium'`, `'soft'`
|
||||
vim.g.everforest_background = 'hard'
|
||||
vim.g.gruvbox_material_better_performance = 1
|
||||
vim.g.everforest_better_performance = 1
|
||||
vim.cmd.colorscheme(color)
|
||||
end
|
||||
|
||||
colors()
|
||||
90
config/.config/nvim/after/plugin/lsp.lua
Executable file
90
config/.config/nvim/after/plugin/lsp.lua
Executable file
@@ -0,0 +1,90 @@
|
||||
local lsp = require('lsp-zero')
|
||||
local lsp_config = require("lspconfig")
|
||||
|
||||
lsp.preset('recommended')
|
||||
|
||||
lsp.ensure_installed({
|
||||
'lua_ls',
|
||||
})
|
||||
|
||||
--Enable (broadcasting) snippet capability for completion
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
lsp_config.html.setup {
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "etlua" },
|
||||
}
|
||||
|
||||
lsp_config.nim_langserver.setup{
|
||||
settings = {
|
||||
nim = {
|
||||
projectMapping = {
|
||||
projectFile = "main.nim",
|
||||
fileRegex = ".*\\.nim"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local cmp = require("cmp")
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({select = true}),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
cmp.setup {
|
||||
sources = {
|
||||
-- { name = 'conjure' },
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}
|
||||
}
|
||||
|
||||
lsp.set_preferences({
|
||||
sign_icons = { }
|
||||
})
|
||||
|
||||
lsp.setup_nvim_cmp({
|
||||
mapping = cmp_mappings
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
|
||||
if client.name == "eslint" then
|
||||
vim.cmd.LspStop('eslint')
|
||||
return
|
||||
end
|
||||
if client.name == "html" or client.name == "cssls" then
|
||||
capabilities = capabilities
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts)
|
||||
vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>vca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
end)
|
||||
|
||||
lsp_config.lua_ls.setup {
|
||||
-- ... other configs
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lsp_config.racket_langserver.setup{}
|
||||
lsp.setup()
|
||||
15
config/.config/nvim/after/plugin/telescope.lua
Executable file
15
config/.config/nvim/after/plugin/telescope.lua
Executable file
@@ -0,0 +1,15 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
local telescope = require('telescope')
|
||||
telescope.load_extension("workspaces")
|
||||
telescope.load_extension("recent_files")
|
||||
telescope.load_extension("telescope-tabs")
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fF', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>bb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>hh', builtin.help_tags, {})
|
||||
vim.keymap.set('n', '<leader>cc', builtin.colorscheme, {})
|
||||
vim.keymap.set('n', '<leader>wo', ":Telescope workspaces<CR>", {})
|
||||
vim.api.nvim_set_keymap("n", "<leader>fr",
|
||||
[[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]],
|
||||
{noremap = true, silent = true})
|
||||
22
config/.config/nvim/after/plugin/treesitter.lua
Executable file
22
config/.config/nvim/after/plugin/treesitter.lua
Executable file
@@ -0,0 +1,22 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "help", "java", "c", "lua" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
2
config/.config/nvim/after/plugin/undotree.lua
Executable file
2
config/.config/nvim/after/plugin/undotree.lua
Executable file
@@ -0,0 +1,2 @@
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
|
||||
Reference in New Issue
Block a user