From a8c4cad4c0863bd8df99d2335590c23dc5c4a356 Mon Sep 17 00:00:00 2001 From: FredzyW Date: Tue, 29 Oct 2024 21:14:01 +0100 Subject: [PATCH] Fixed some refactors --- README.md | 17 ++++++++++++++--- init.lua | 2 -- lua/keybindings/keymap.lua | 10 +--------- lua/plugin/cmp.lua | 3 ++- lua/plugin/lsp_config.lua | 7 +------ lua/plugin/lualine.lua | 18 +----------------- 6 files changed, 19 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 0a7496f..67c7c01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ -# nvim +# neovim -Detta är ett repo för att hålla filerna till min NeoVim konfiguration. +My Neovim configuration. -Konfigurationen är ganska minimal estetiskt, men har hyfsat mycket funktionalitet. +If you are on NixOS, you need to have the following language servers in your installation: + +```nix +nil +jdt-language-server +texlab +marksman +nodePackages_latest.bash-language-server +lua-language-server +tree-sitter +gopls +``` diff --git a/init.lua b/init.lua index 1537712..3487608 100644 --- a/init.lua +++ b/init.lua @@ -14,8 +14,6 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) --- vim.api.nvim_command('autocmd VimEnter * lua require("lualine").hide()') - require("lazy").setup("plugins") -- Keybindsings diff --git a/lua/keybindings/keymap.lua b/lua/keybindings/keymap.lua index 8a5c80c..6bb2b3e 100644 --- a/lua/keybindings/keymap.lua +++ b/lua/keybindings/keymap.lua @@ -24,12 +24,6 @@ vim.keymap.set("n", "ss", require('substitute').line, { noremap = true }) vim.keymap.set("n", "S", require('substitute').eol, { noremap = true }) vim.keymap.set("x", "s", require('substitute').visual, { noremap = true }) --- Move commands -vim.keymap.set('n', '', ':MoveLine(1)', opts) -vim.keymap.set('n', '', ':MoveLine(-1)', opts) -vim.keymap.set('v', '', ':MoveBlock(1)', opts) -vim.keymap.set('v', '', ':MoveBlock(-1)', opts) - -- Good navigation mappings for wrap vim.api.nvim_set_keymap('n', 'j', 'gj', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'k', 'gk', { noremap = true, silent = true }) @@ -43,7 +37,6 @@ vim.api.nvim_set_keymap('n', '', ':wincmd k', { silent = true }) vim.api.nvim_set_keymap('n', '', ':wincmd j', { silent = true }) vim.api.nvim_set_keymap('n', '', ':wincmd h', { silent = true }) vim.api.nvim_set_keymap('n', '', ':wincmd l', { silent = true }) - vim.api.nvim_set_keymap('n', 'c', ':bd', { silent = true }) -- Highlight yanked @@ -55,17 +48,16 @@ vim.api.nvim_create_autocmd('TextYankPost', { vim.highlight.on_yank { higroup = 'IncSearch', timeout = 50 } end, }) + -- Telescope bindings local builtin = require('telescope.builtin') vim.keymap.set('n', 'f', builtin.find_files, {}) vim.keymap.set('n', 'o', builtin.live_grep, {}) - vim.keymap.set('n', 'gc', builtin.git_commits, {}) vim.keymap.set('n', 'gs', builtin.git_status, {}) vim.keymap.set('n', 'gf', builtin.git_files, {}) vim.keymap.set('n', '7', builtin.current_buffer_fuzzy_find, {}) - -- Bindings for save and quit vim.api.nvim_set_keymap('n', 'w', ':w', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'q', ':q', {}) diff --git a/lua/plugin/cmp.lua b/lua/plugin/cmp.lua index 2500e47..ac44c89 100644 --- a/lua/plugin/cmp.lua +++ b/lua/plugin/cmp.lua @@ -10,7 +10,8 @@ cmp.setup({ [''] = cmp.mapping.abort(), [''] = cmp.mapping.select_prev_item({ behavior = 'select' }), [''] = cmp.mapping.select_next_item({ behavior = 'select' }), - [''] = cmp.mapping.select_next_item({ behavior = 'select' }), + [''] = cmp.mapping.select_prev_item({ behavior = 'insert' }), + [''] = cmp.mapping.select_next_item({ behavior = 'insert' }), [''] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item({ behavior = 'insert' }) diff --git a/lua/plugin/lsp_config.lua b/lua/plugin/lsp_config.lua index b1763c9..7b7c72c 100644 --- a/lua/plugin/lsp_config.lua +++ b/lua/plugin/lsp_config.lua @@ -1,14 +1,9 @@ -- LSP Setup local lsp_zero = require('lsp-zero') -lsp_zero.on_attach(function(client, bufnr) +lsp_zero.on_attach(function(bufnr) lsp_zero.default_keymaps({ buffer = bufnr }) end) -require 'lspconfig'.hls.setup {} -require 'lspconfig'.omnisharp.setup { - cmd = { "/home/fw/.nix-profile/bin/dotnet", "/home/fw/.local/share/lvim/mason/packages/omnisharp/libexec/OmniSharp.dll" }, -} -require 'lspconfig'.clojure_lsp.setup {} require 'lspconfig'.nil_ls.setup {} require 'lspconfig'.marksman.setup {} require 'lspconfig'.pylsp.setup {} diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index 2459c43..2af042a 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -1,12 +1,8 @@ require('lualine').hide() require('lualine').setup { options = { - -- icons_enabled = true, icons_enabled = false, - theme = 'base16', - -- theme = 'catppuccin-mocha', - -- component_separators = { left = '', right = ''}, - -- section_separators = { left = '', right = ''}, + theme = 'catppuccin-mocha', component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, disabled_filetypes = { @@ -39,20 +35,8 @@ require('lualine').setup { lualine_z = {} }, tabline = { - -- lualine_a = {'buffers'}, - -- lualine_b = {}, - -- lualine_c = {}, - -- lualine_x = {}, - -- lualine_y = {}, - -- lualine_z = {} }, winbar = { - -- lualine_a = {'buffers'}, - -- lualine_b = {}, - -- lualine_c = {}, - -- lualine_x = {}, - -- lualine_y = {}, - -- lualine_z = {} }, inactive_winbar = {}, extensions = {}