From f5e8a5c13c10dd93d614dea2530877ef48071a22 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Wed, 22 May 2024 08:05:23 +0200 Subject: Update neovim, tweak some things --- Common/nvim/lua/basic.lua | 16 +++++++-------- Common/nvim/lua/helper_functions.lua | 17 +++++++++++++++ Common/nvim/lua/lsp-conf.lua | 4 ---- Common/nvim/lua/plugins.lua | 40 +----------------------------------- 4 files changed, 26 insertions(+), 51 deletions(-) (limited to 'Common/nvim') diff --git a/Common/nvim/lua/basic.lua b/Common/nvim/lua/basic.lua index f5bf3a2..cb36189 100755 --- a/Common/nvim/lua/basic.lua +++ b/Common/nvim/lua/basic.lua @@ -18,22 +18,22 @@ vim.opt.softtabstop = 4 vim.api.nvim_set_keymap('n', '', ':noh', { noremap = true, silent = true }) -- Tab commands -vim.api.nvim_set_keymap('n', 'tn', ':tabnext', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'tc', ':tabnew', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'tx', ':tabclose', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tp', ':tabprevious', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tn', ':tabnext', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tc', ':tabnew', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tx', ':tabclose', { noremap = true, silent = true }) --- Return to last edit position when opening files (You want this!) +-- Return to last edit position when opening files vim.cmd [[ au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]] -- Colorscheme -vim.cmd [[ colorscheme default ]] -vim.opt.background = "dark" -vim.opt.termguicolors = true +vim.cmd [[ colorscheme vim ]] +vim.opt.background = "light" -- No idea why, preview in fzf does at least work extremely porly without this vim.cmd [[ let $BAT_THEME = 'gruvbox-light' ]] -- Show colour column vim.opt.colorcolumn = '120' -vim.api.nvim_set_hl(0, "ColorColumn", { ctermbg = "lightgrey", bg = "#363636" }) +vim.api.nvim_set_hl(0, "ColorColumn", { ctermbg = "lightgrey", bg = "#eae7da" }) diff --git a/Common/nvim/lua/helper_functions.lua b/Common/nvim/lua/helper_functions.lua index 5889d5b..88eeb68 100755 --- a/Common/nvim/lua/helper_functions.lua +++ b/Common/nvim/lua/helper_functions.lua @@ -1,3 +1,20 @@ +-- Load local configuration +-- For me this is usually something like +-- let g:vimwiki_list = [ +-- \ {'name': 'I45', 'syntax': 'markdown', 'ext': 'md', 'auto_toc': 1, +-- \ 'path': '~/_library/I45/', +-- \ 'nested_syntaxes': {'python': 'python', 'sql': 'sql', 'ioql': 'ioql'}}, +-- \ {'name': 'P01', 'syntax': 'markdown', 'ext': 'md', 'auto_toc': 1, +-- \ 'path': '~/_library/', +-- \ } +-- \] +-- let g:db = "mysql://user@db001" +vim.cmd [[ +if !empty(glob("~/.env.vim")) + source ~/.env.vim +endif +]] + -- Convenient sudo saving of file vim.api.nvim_create_user_command( 'W', 'w !sudo tee % > /dev/null', diff --git a/Common/nvim/lua/lsp-conf.lua b/Common/nvim/lua/lsp-conf.lua index d80eb3f..2c7463b 100644 --- a/Common/nvim/lua/lsp-conf.lua +++ b/Common/nvim/lua/lsp-conf.lua @@ -61,9 +61,6 @@ vim.opt.signcolumn = 'yes' -- Remove background in SignColumn, looks odd without this vim.api.nvim_set_hl(0, "SignColumn", {link = "LineNr"}) -vim.keymap.set('n', 'd', vim.diagnostic.open_float) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set('n', 'q', vim.diagnostic.setloclist) vim.api.nvim_create_autocmd('LspAttach', { @@ -75,7 +72,6 @@ vim.api.nvim_create_autocmd('LspAttach', { local opts = { buffer = ev.buf } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) diff --git a/Common/nvim/lua/plugins.lua b/Common/nvim/lua/plugins.lua index 67bd4d1..1faf832 100755 --- a/Common/nvim/lua/plugins.lua +++ b/Common/nvim/lua/plugins.lua @@ -90,57 +90,19 @@ return require('packer').startup(function(use) nmap dbb (DBExeLine) autocmd FileType dbout setlocal nofoldenable - - if !empty(glob("~/.env.vim")) - source ~/.env.vim - endif ]] end, } -- Useful for wide screens use { - 'smithbm2316/centerpad.nvim' + 'junegunn/goyo.vim' } -- VimWiki stuff use { 'vimwiki/vimwiki', config = function () - vim.g.vimwiki_list = { - { - path = '~/Nextcloud/2-Områder/204-profesjonelt/204.06-infomedia/204.06.AA-wiki', - syntax = 'markdown', - ext = 'md', - name = 'I45', - auto_toc = 1, - diary_frequency = 'daily', - nested_syntaxes = { - python = 'python', - sql = 'sql', - }, - }, - { - path = '~/Nextcloud/1-Prosjekter/101-masteroppgave/101.02-quick-notes', - syntax = 'markdown', - ext = 'md', - name = 'P101', - auto_toc = 1, - nested_syntaxes = { - python = 'python', - sql = 'sql', - }, - }, - { - path = '~/Nextcloud/', - syntax = 'markdown', - ext = 'md', - name = 'P01', - --nested_syntaxes = { - -- python = 'python', - --}, - }, - } vim.g.vimwiki_global_ext = 0 vim.g.vimwiki_auto_header = 1 vim.g.vimwiki_links_space_char = '_' -- cgit v1.2.3