first setup

This commit is contained in:
radumacocian
2024-08-18 18:41:41 +02:00
commit 984c55deac
353 changed files with 523 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
function ColorMyPencils(color)
color = color or "everforest"
vim.cmd.colorscheme(color)
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end
ColorMyPencils()

View File

@@ -0,0 +1 @@
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)

View File

@@ -0,0 +1,9 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end)
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end)
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end)
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end)

View File

@@ -0,0 +1,101 @@
local lspconfig = require('lspconfig')
local project_library_path = vim.fn.getcwd() .. '/node_modules'
local angular_cmd = {
'ngserver',
'--stdio',
'--tsProbeLocations',
project_library_path,
'--ngProbeLocations',
project_library_path .. '@angular/language-server'
}
lspconfig.tsserver.setup {}
lspconfig.angularls.setup({
cmd = angular_cmd,
on_new_config = function(new_config, new_root_dir)
new_config.cmd = angular_cmd
end
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
lspconfig.cssls.setup {
capabilities = capabilities,
}
lspconfig.lua_ls.setup {}
require('roslyn').setup({
config = {
settings = {
["csharp|inlay_hints"] = {
csharp_enable_inlay_hints_for_implicit_object_creation = true,
csharp_enable_inlay_hints_for_implicit_variable_types = true,
csharp_enable_inlay_hints_for_lambda_parameter_types = true,
csharp_enable_inlay_hints_for_types = true,
dotnet_enable_inlay_hints_for_indexer_parameters = true,
dotnet_enable_inlay_hints_for_literal_parameters = true,
dotnet_enable_inlay_hints_for_object_creation_parameters = true,
dotnet_enable_inlay_hints_for_other_parameters = true,
dotnet_enable_inlay_hints_for_parameters = true,
dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix = true,
dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name = true,
dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent = true,
},
},
},
exe = {
"dotnet",
vim.fs.joinpath(vim.fn.stdpath("data"), "roslyn", "Microsoft.CodeAnalysis.LanguageServer.dll"),
},
filewatching = true,
})
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('user_lsp_attach', { clear = true }),
callback = function(event)
local opts = { buffer = event.buf }
vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end, opts)
vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts)
vim.keymap.set('n', '<leader>vws', function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set('n', '<leader>vd', function() vim.diagnostic.open_float() end, opts)
vim.keymap.set('n', '<leader>gi', function() vim.lsp.buf.implementation() end, opts)
vim.keymap.set('n', '[d', function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set('n', ']d', function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set('n', '<leader>vca', function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set('n', '<leader>vrr', function() vim.lsp.buf.references() end, opts)
vim.keymap.set('n', '<leader>vrn', function() vim.lsp.buf.rename() end, opts)
vim.keymap.set('i', '<C-h>', function() vim.lsp.buf.signature_help() end, opts)
vim.keymap.set('n', '<F3>', function() vim.lsp.buf.format({ async = true }) end, opts)
end,
})
local cmp = require('cmp')
local cmp_select = { behavior = cmp.SelectBehavior.Select }
-- this is the function that loads the extra snippets to luasnip
-- from rafamadriz/friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load()
cmp.setup({
sources = {
{ name = 'path' },
{ name = 'nvim_lsp' },
{ name = 'luasnip', keyword_length = 2 },
{ name = 'buffer', keyword_length = 3 },
},
mapping = cmp.mapping.preset.insert({
['<C-k>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-j>'] = cmp.mapping.select_next_item(cmp_select),
['<Tab>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
})
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]

View File

@@ -0,0 +1 @@
require('lualine').setup()

View File

@@ -0,0 +1 @@
require("mason").setup()

View File

@@ -0,0 +1 @@
vim.keymap.set("n", "<leader>gr", ":Merginal<CR>")

View File

@@ -0,0 +1,6 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<C-p>p', builtin.git_files, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)

View File

@@ -0,0 +1,24 @@
require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = { "vimdoc", "javascript", "typescript", "c_sharp", "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
-- 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,
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
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,
},
}

View File

@@ -0,0 +1 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)