From ec9e49f65bcf42dc2d6b5863782ed4c2b5d42816 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Sun, 2 Apr 2023 22:28:47 +0200 Subject: [PATCH] nvim: remove old config --- config/nvim/init.lua | 125 -------------------------- config/nvim/lua/go.lua | 7 -- config/nvim/lua/plugin.theme.lua | 14 --- config/nvim/lua/plugin_completion.lua | 12 --- config/nvim/lua/plugin_theme.lua | 14 --- config/nvim/lua/plugins.lua | 114 ----------------------- 6 files changed, 286 deletions(-) delete mode 100644 config/nvim/init.lua delete mode 100644 config/nvim/lua/go.lua delete mode 100644 config/nvim/lua/plugin.theme.lua delete mode 100644 config/nvim/lua/plugin_completion.lua delete mode 100644 config/nvim/lua/plugin_theme.lua delete mode 100644 config/nvim/lua/plugins.lua diff --git a/config/nvim/init.lua b/config/nvim/init.lua deleted file mode 100644 index 6b9d50a..0000000 --- a/config/nvim/init.lua +++ /dev/null @@ -1,125 +0,0 @@ --- highlight column 80 -vim.wo.colorcolumn = '80' - --- make space the leader key -vim.g.mapleader = ' ' - --- tab bindings are atrocious -vim.api.nvim_set_keymap("n", "tr", ":bp", {}) -vim.api.nvim_set_keymap("n", "tz", ":bn", {}) -vim.api.nvim_set_keymap("n", "tc", ":bd", {}) -vim.api.nvim_set_keymap("n", "-", ":Explore", {}) - --- disable those useless shits -vim.api.nvim_set_keymap("n", "", "", {}) -vim.api.nvim_set_keymap("n", "", "", {}) - --- clear highlights on enter and escape -vim.opt.incsearch = true -vim.opt.hlsearch = true -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.api.nvim_set_keymap("n", "", ":noh", {silent = true}) -vim.api.nvim_set_keymap("n", "", ":noh", {silent = true}) - --- completion-menu -vim.opt.wildmode = "longest,list,full" -vim.opt.completeopt = "longest,menuone" - --- auto-load changes -vim.opt.autoread = true - --- always show 2 lines around the cursor -vim.opt.scrolloff = 2 - --- don't expand cache or temporary paths -vim.opt.wildignore = {'*/cache/*', '*/tmp/*'} - --- show line numbers -vim.opt.number = true - --- syntax highlighting… we aren't savages -vim.opt.syntax = "enable" - --- make :find actually find things -vim.opt.path = vim.opt.path + ",**" - --- disable mouse -vim.opt.mouse = "" - --- sane indentation settings -vim.opt.autoindent = true -vim.opt.shiftwidth = 8 -vim.opt.softtabstop = 8 -vim.opt.tabstop = 8 -vim.opt.expandtab = false - --- wrapping at whitespace -vim.opt.lbr = true -vim.opt.breakindent = true -vim.opt.formatoptions = "tcrqn1j" - --- unmap space and reassign as -vim.api.nvim_set_keymap('', '', '', { noremap = true, silent = true }) -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- map quickfix stuff to c -vim.api.nvim_set_keymap('n', 'cc', ':cw', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'cg', ':.cc', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'cn', ':cn', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'cp', ':cp', { noremap = true, silent = true }) - -vim.api.nvim_set_keymap('n', '', ':wincmd k', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':wincmd j', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':wincmd h', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':wincmd l', { noremap = true, silent = true }) - --- TODO: find alternative --- vim.keymap.set('n', 'gb', ':call setbufvar(winbufnr(popup_atcursor(systemlist("cd " . shellescape(fnamemodify(resolve(expand("%:p")), ":h")) . " && git log --no-merges -n 1 -L " . shellescape(line("v") . "," . line(".") . ":" . resolve(expand("%:p")))), { "padding": [1,1,1,1], "pos": "botleft", "wrap": 0 })), "&filetype", "git")') - --- strings used in list mode --- vim.opt.listchars = 'eol:↲,tab:→,trail:·,extends:▶,precedes:◀' - --- restore cursor position -local function restore_cursor() - if vim.fn.line("'\"") > 1 and vim.fn.line("'\"") <= vim.fn.line("$") then - vim.cmd("normal! g'\"") - end -end -vim.api.nvim_create_autocmd({"BufReadPost"}, { callback = restore_cursor }) - --- start git commits and rebases in insert mode -vim.api.nvim_create_augroup("bufcheck", { clear = true }) -vim.api.nvim_create_autocmd("FileType", { - group = "bufcheck", - pattern = { "gitcommit" }, - command = "startinsert | 1", -}) - -require('plugins') -require('plugin_theme') -require('plugin_completion') -- also for snippets -require('go') - --- ALE use quickfix window -vim.g.ale_set_loclist = 0 -vim.g.ale_set_quickfix = 1 - --- harpoon keybindings -vim.api.nvim_set_keymap('n','p', ':lua require("harpoon.mark").add_file()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n','d', ':lua require("harpoon.mark").rm_file()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n','h', ':lua require("harpoon.ui").nav_prev()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n','l', ':lua require("harpoon.ui").nav_next()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n','', ':lua require("harpoon.ui").toggle_quick_menu()', { noremap = true, silent = true }) - -require("harpoon").setup({ - -- sets the marks upon calling `toggle` on the ui, instead of require `:w`. - save_on_toggle = true, - - -- filetypes that you want to prevent from adding to the harpoon list menu. - excluded_filetypes = { "harpoon" }, - - -- set marks specific to each git branch inside git repository - mark_branch = true, -}) diff --git a/config/nvim/lua/go.lua b/config/nvim/lua/go.lua deleted file mode 100644 index d1b97c5..0000000 --- a/config/nvim/lua/go.lua +++ /dev/null @@ -1,7 +0,0 @@ -vim.g['go_fmt_command'] = "gopls" -vim.g['go_gopls_gofumpt'] = 1 -vim.g['go_auto_type_info'] = 1 - --- Custom keybindings from hell -vim.keymap.set('n', 'gie', 'GoIfErr' ) -vim.keymap.set('n', 'gis', 'GoFillStruct' ) diff --git a/config/nvim/lua/plugin.theme.lua b/config/nvim/lua/plugin.theme.lua deleted file mode 100644 index dd50a79..0000000 --- a/config/nvim/lua/plugin.theme.lua +++ /dev/null @@ -1,14 +0,0 @@ -vim.opt.termguicolors = true - -require('onedark').setup { - style = "cool", - transparent = true, - code_style = { - comments = 'italic', - keywords = 'italic,bold', - functions = 'none', - strings = 'none', - variables = 'none' - }, -} -require('onedark').load() diff --git a/config/nvim/lua/plugin_completion.lua b/config/nvim/lua/plugin_completion.lua deleted file mode 100644 index 7dbc1eb..0000000 --- a/config/nvim/lua/plugin_completion.lua +++ /dev/null @@ -1,12 +0,0 @@ -vim.g['deoplete#enable_at_startup'] = 1 -vim.g['deoplete#complete_method'] = "omnifunc" - -vim.g['ale_sign_error'] = '❌' -vim.g['ale_sign_warning'] = '⚠' - -vim.cmd [[call deoplete#custom#option('omni_patterns', {'go': '[^. *\t]\.\w*', 'html': ['<', ']*\s[[:alnum:]-]*'],})]] - -vim.api.nvim_set_keymap("i", "", 'pumvisible() ? "" : deoplete#manual_complete()', {noremap=true}) -vim.api.nvim_set_keymap("i", "", 'pumvisible() ? "" : deoplete#manual_complete()', {noremap=true}) - --- TODO: diff --git a/config/nvim/lua/plugin_theme.lua b/config/nvim/lua/plugin_theme.lua deleted file mode 100644 index dd50a79..0000000 --- a/config/nvim/lua/plugin_theme.lua +++ /dev/null @@ -1,14 +0,0 @@ -vim.opt.termguicolors = true - -require('onedark').setup { - style = "cool", - transparent = true, - code_style = { - comments = 'italic', - keywords = 'italic,bold', - functions = 'none', - strings = 'none', - variables = 'none' - }, -} -require('onedark').load() diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua deleted file mode 100644 index 959ed2c..0000000 --- a/config/nvim/lua/plugins.lua +++ /dev/null @@ -1,114 +0,0 @@ -local fn = vim.fn -local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' -if fn.empty(fn.glob(install_path)) > 0 then - packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - -- fn.system({'yay', '-Syu', 'go', 'shellcheck', 'python', '--noconfirm'}) - vim.cmd("terminal yay -Syu go shellcheck python --noconfirm") -end - -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source | PackerCompile - augroup end -]]) - -return require('packer').startup({function(use) - use 'wbthomason/packer.nvim' - - use 'navarasu/onedark.nvim' - - use 'airblade/vim-gitgutter' - - use { - 'kdheepak/tabline.nvim', - config = function() - require'tabline'.setup { - -- Defaults configuration options - enable = true, - options = { - -- If lualine is installed tabline will use separators configured in lualine by default. - -- These options can be used to override those settings. - section_separators = {'', ''}, - component_separators = {'', ''}, - max_bufferline_percent = 66, -- set to nil by default, and it uses vim.o.columns * 2/3 - show_tabs_always = false, -- this shows tabs only when there are more than one tab or if the first tab is named - show_devicons = true, -- this shows devicons in buffer section - show_bufnr = false, -- this appends [bufnr] to buffer section, - show_filename_only = false, -- shows base filename only instead of relative path in filename - modified_icon = "* ", -- change the default modified icon - modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified - show_tabs_only = false, -- this shows only tabs instead of tabs + buffers - } - } - vim.cmd[[ - set guioptions-=e " Use showtabline in gui vim - set sessionoptions+=tabpages,globals " store tabpages and globals in session - ]] - end, - requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} } - } - - use { - 'tpope/vim-dispatch', - opt = true, - cmd = {'Dispatch', 'Make', 'Focus', 'Start'} - } - - use { - 'fatih/vim-go', - ft = {'go'}, - run = function() vim.cmd([[GoUpdateBinaries]]) end - } - - use { - 'codelitt/vim-qtpl', - ft = {'qtpl'}, - } - - use { - 'SirVer/ultisnips', - ft = {'go'} - } - use { - 'honza/vim-snippets', - ft = {'go'} - } - - use { - 'w0rp/ale', - ft = {'go', 'sh'} - } - - use { 'Shougo/deoplete.nvim' } - use { 'Shougo/neosnippet.vim' } - use { 'Shougo/neosnippet-snippets' } - - use { 'nvim-lua/plenary.nvim' } - use { 'ThePrimeagen/harpoon' } - - use { 'tommcdo/vim-lion' } - - use { 'ThePrimeagen/vim-be-good' } - - use { 'lambdalisue/suda.vim' } - - use { 'tpope/vim-fugitive' } - - use { 'tpope/vim-dadbod' } - use { 'tpope/vim-commentary' } - use { 'tpope/vim-eunuch' } - use { 'tommcdo/vim-lion' } - - if packer_bootstrap then - require('packer').sync() - vim.fn.PackerInstall() - end -end, -config = { - display = { - open_fn = function() - return require('packer.util').float({ border = 'single' }) - end - } -}}) -- 2.45.2