From 58e7fc2ee1e3c45cee33922554ad98489ab57acf Mon Sep 17 00:00:00 2001 From: femsci Date: Sat, 4 Nov 2023 12:47:20 +0100 Subject: [PATCH] keybinds --- init.lua | 70 ++++++++++++++++++++++++++++++++++--------------- lua/.luarc.json | 3 ++- 2 files changed, 51 insertions(+), 22 deletions(-) diff --git a/init.lua b/init.lua index ca4a781..da72961 100644 --- a/init.lua +++ b/init.lua @@ -1,12 +1,15 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 +vim.g.mapleader = " " local wo = vim.wo local bo = vim.bo +local op = vim.opt -vim.opt.termguicolors = true -bo.tabstop = 2 -bo.shiftwidth = 2 +op.termguicolors = true +op.tabstop = 4 +op.shiftwidth = 4 +op.expandtab = true bo.autoindent = true bo.expandtab = true wo.number = 1 @@ -39,7 +42,10 @@ packer.startup(function(use) use 'neovim/nvim-lspconfig' use 'mfussenegger/nvim-dap' 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 'williamboman/mason.nvim' use 'williamboman/mason-lspconfig.nvim' @@ -48,9 +54,9 @@ packer.startup(function(use) use 'hrsh7th/nvim-cmp' use 'hrsh7th/vim-vsnip' use 'onsails/lspkind.nvim' - use 'antoinemadec/FixCursorHold.nvim' + use 'antoinemadec/FixCursorHold.nvim' use 'olimorris/onedarkpro.nvim' - use { + use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' } @@ -182,7 +188,7 @@ require('lspconfig')['rust_analyzer'].setup{ ["rust-analyzer"] = {} } } -require'lspconfig'.sumneko_lua.setup { +require'lspconfig'.lua_ls.setup { settings = { Lua = { runtime = { @@ -207,7 +213,7 @@ require'lspconfig'.sumneko_lua.setup { require'lspconfig'.omnisharp.setup { 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 -- settings from .editorconfig. @@ -246,7 +252,7 @@ require'lspconfig'.omnisharp.setup { } require("mason-lspconfig").setup({ - ensure_installed = { "sumneko_lua", "rust_analyzer" } + ensure_installed = { "lua_ls", "rust_analyzer" } }) local cmp = require('cmp') @@ -322,28 +328,40 @@ cmp.setup { } require("nvim-tree").setup({ - open_on_setup = true, sort_by = "case_sensitive", view = { adaptive_size = true, - mappings = { - list = { - { key = "u", action = "dir_up" }, - }, }, - }, renderer = { group_empty = true, }, filters = { - dotfiles = true, + dotfiles = false, }, }) -require("indent_blankline").setup { - show_current_context = true, - show_current_context_start = true, -} +local hooks = require "ibl.hooks" +-- create the highlight groups in the highlight setup hook, so they are reset +-- 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("bufferline").setup { @@ -406,5 +424,15 @@ require('lualine').setup { extensions = {} } -vim.api.nvim_set_keymap('n', '', ':NvimTreeFocus', { noremap = true }) +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, {}) +vim.keymap.set('n', 'fg', builtin.live_grep, {}) +vim.keymap.set('n', 'fb', builtin.buffers, {}) +vim.keymap.set('n', 'fh', builtin.help_tags, {}) + +--vim.api.nvim_set_keymap('n', '', ':BufferLineCyclePrev', { noremap = true })-- +vim.api.nvim_set_keymap('n', '', ':BufferLineCycleNext', { noremap = true }) + +vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { noremap = true }) vim.api.nvim_set_keymap('n', '', ':TroubleToggle', { noremap = true }) +vim.api.nvim_set_keymap('n', '', ':CodeActionMenu', { noremap = true }) diff --git a/lua/.luarc.json b/lua/.luarc.json index a7a1ee4..f9edeae 100644 --- a/lua/.luarc.json +++ b/lua/.luarc.json @@ -27,5 +27,6 @@ "/usr/lib/nvim", "/usr/share/vim/vimfiles", "${3rd}/luassert/library" - ] + ], + "workspace.checkThirdParty": false } \ No newline at end of file