This commit is contained in:
femsci 2023-11-04 12:47:20 +01:00
parent ea4822b11b
commit 58e7fc2ee1
Signed by: femsci
GPG key ID: 08F7911F0E650C67
2 changed files with 51 additions and 22 deletions

View file

@ -1,12 +1,15 @@
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
vim.g.mapleader = " "
local wo = vim.wo local wo = vim.wo
local bo = vim.bo local bo = vim.bo
local op = vim.opt
vim.opt.termguicolors = true op.termguicolors = true
bo.tabstop = 2 op.tabstop = 4
bo.shiftwidth = 2 op.shiftwidth = 4
op.expandtab = true
bo.autoindent = true bo.autoindent = true
bo.expandtab = true bo.expandtab = true
wo.number = 1 wo.number = 1
@ -39,7 +42,10 @@ packer.startup(function(use)
use 'neovim/nvim-lspconfig' use 'neovim/nvim-lspconfig'
use 'mfussenegger/nvim-dap' use 'mfussenegger/nvim-dap'
use 'jose-elias-alvarez/null-ls.nvim' use 'jose-elias-alvarez/null-ls.nvim'
use 'nvim-telescope/telescope.nvim' use {
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'lewis6991/gitsigns.nvim' use 'lewis6991/gitsigns.nvim'
use 'williamboman/mason.nvim' use 'williamboman/mason.nvim'
use 'williamboman/mason-lspconfig.nvim' use 'williamboman/mason-lspconfig.nvim'
@ -48,9 +54,9 @@ packer.startup(function(use)
use 'hrsh7th/nvim-cmp' use 'hrsh7th/nvim-cmp'
use 'hrsh7th/vim-vsnip' use 'hrsh7th/vim-vsnip'
use 'onsails/lspkind.nvim' use 'onsails/lspkind.nvim'
use 'antoinemadec/FixCursorHold.nvim' use 'antoinemadec/FixCursorHold.nvim'
use 'olimorris/onedarkpro.nvim' use 'olimorris/onedarkpro.nvim'
use { use {
'weilbith/nvim-code-action-menu', 'weilbith/nvim-code-action-menu',
cmd = 'CodeActionMenu' cmd = 'CodeActionMenu'
} }
@ -182,7 +188,7 @@ require('lspconfig')['rust_analyzer'].setup{
["rust-analyzer"] = {} ["rust-analyzer"] = {}
} }
} }
require'lspconfig'.sumneko_lua.setup { require'lspconfig'.lua_ls.setup {
settings = { settings = {
Lua = { Lua = {
runtime = { runtime = {
@ -207,7 +213,7 @@ require'lspconfig'.sumneko_lua.setup {
require'lspconfig'.omnisharp.setup { require'lspconfig'.omnisharp.setup {
capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()), capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()),
cmd = { "dotnet", "/home/nya/.vscode-oss/extensions/ms-dotnettools.csharp-1.25.2-linux-x64/.omnisharp/1.39.2-net6.0/OmniSharp.dll" }, cmd = { "/home/nya/.local/share/nvim/mason/bin/omnisharp" },
-- Enables support for reading code style, naming convention and analyzer -- Enables support for reading code style, naming convention and analyzer
-- settings from .editorconfig. -- settings from .editorconfig.
@ -246,7 +252,7 @@ require'lspconfig'.omnisharp.setup {
} }
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { "sumneko_lua", "rust_analyzer" } ensure_installed = { "lua_ls", "rust_analyzer" }
}) })
local cmp = require('cmp') local cmp = require('cmp')
@ -322,28 +328,40 @@ cmp.setup {
} }
require("nvim-tree").setup({ require("nvim-tree").setup({
open_on_setup = true,
sort_by = "case_sensitive", sort_by = "case_sensitive",
view = { view = {
adaptive_size = true, adaptive_size = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
}, },
},
renderer = { renderer = {
group_empty = true, group_empty = true,
}, },
filters = { filters = {
dotfiles = true, dotfiles = false,
}, },
}) })
require("indent_blankline").setup { local hooks = require "ibl.hooks"
show_current_context = true, -- create the highlight groups in the highlight setup hook, so they are reset
show_current_context_start = true, -- every time the colorscheme changes
} hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
require("ibl").setup { indent = { highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
} } }
require('colorizer').setup() require('colorizer').setup()
require("bufferline").setup { require("bufferline").setup {
@ -406,5 +424,15 @@ require('lualine').setup {
extensions = {} extensions = {}
} }
vim.api.nvim_set_keymap('n', '<C-t>', ':NvimTreeFocus<CR>', { noremap = true }) local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
--vim.api.nvim_set_keymap('n', '<C-Tab>', ':BufferLineCyclePrev<CR>', { noremap = true })--
vim.api.nvim_set_keymap('n', '<S-Tab>', ':BufferLineCycleNext<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-`>', ':NvimTreeToggle<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<A-t>', ':TroubleToggle<CR>', { noremap = true }) vim.api.nvim_set_keymap('n', '<A-t>', ':TroubleToggle<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<A-CR>', ':CodeActionMenu<CR>', { noremap = true })

View file

@ -27,5 +27,6 @@
"/usr/lib/nvim", "/usr/lib/nvim",
"/usr/share/vim/vimfiles", "/usr/share/vim/vimfiles",
"${3rd}/luassert/library" "${3rd}/luassert/library"
] ],
"workspace.checkThirdParty": false
} }