diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-06-10 23:07:28 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-06-10 23:07:28 +0200 |
commit | 511efe89ed084bc922ae142d32e08427859198f4 (patch) | |
tree | fef9294b6056b6cf972ea5e689f70da8184fafae /.config/nvim/lua/mango | |
parent | 64e2e90abdca04743558e3baf42a6b714b440bd0 (diff) |
nvim: Completely rewrite my configuration
Diffstat (limited to '.config/nvim/lua/mango')
-rw-r--r-- | .config/nvim/lua/mango/init.lua | 3 | ||||
-rw-r--r-- | .config/nvim/lua/mango/lib.lua | 36 | ||||
-rw-r--r-- | .config/nvim/lua/mango/packer.lua | 59 | ||||
-rw-r--r-- | .config/nvim/lua/mango/remap.lua | 54 | ||||
-rw-r--r-- | .config/nvim/lua/mango/set.lua | 72 |
5 files changed, 0 insertions, 224 deletions
diff --git a/.config/nvim/lua/mango/init.lua b/.config/nvim/lua/mango/init.lua deleted file mode 100644 index 9e7f273..0000000 --- a/.config/nvim/lua/mango/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require('mango.packer') -require('mango.remap') -require('mango.set') diff --git a/.config/nvim/lua/mango/lib.lua b/.config/nvim/lua/mango/lib.lua deleted file mode 100644 index e062352..0000000 --- a/.config/nvim/lua/mango/lib.lua +++ /dev/null @@ -1,36 +0,0 @@ -local M = {} - -function M.set_tab_width(tw, localp) - local opt = localp and vim.opt_local or vim.opt - - opt.tabstop = tw - opt.softtabstop = tw - opt.shiftwidth = tw -end - -function M.remap(modes, from, to, opts) - local ct = {} - - modes:gsub('.', function(c) - table.insert(ct, c) - end) - - vim.keymap.set(ct, from, to, opts or { - noremap = true, - silent = true, - }) -end - -function M.scratch_buffer() - vim.cmd [[ - if bufexists('scratch') - buffer scratch - else - noswapfile hide enew - setlocal buftype=nofile bufhidden=hide - file scratch - endif - ]] -end - -return M diff --git a/.config/nvim/lua/mango/packer.lua b/.config/nvim/lua/mango/packer.lua deleted file mode 100644 index 8b5c583..0000000 --- a/.config/nvim/lua/mango/packer.lua +++ /dev/null @@ -1,59 +0,0 @@ -vim.cmd.packadd('packer.nvim') - -return require('packer').startup(function(use) - -- Package manager - use 'wbthomason/packer.nvim' - - -- Colorscheme - use { - 'rose-pine/neovim', - as = 'rose-pine', - } - - -- More textobjects; more is more - use 'wellle/targets.vim' - use { - 'nvim-treesitter/nvim-treesitter-textobjects', - after = 'nvim-treesitter', - requires = 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate', - } - - -- Efficiency improvements - use 'kylechui/nvim-surround' - use 'mattn/emmet-vim' - use 'numToStr/Comment.nvim' - use 'christoomey/vim-sort-motion' - - -- Git integration - use 'tpope/vim-fugitive' - - -- Improvements to builtin functionality - use 'mbbill/undotree' - use 'tpope/vim-speeddating' - - -- Additional language support - use 'Glench/Vim-Jinja2-Syntax' - use 'https://git.sr.ht/~mango/tree-sitter-gsp' - use 'luckasRanarison/tree-sitter-hypr' - - -- LSP support and completions - use 'neovim/nvim-lspconfig' - use { - 'hrsh7th/nvim-cmp', - requires = { - -- Completion backends - { 'hrsh7th/cmp-buffer' }, - { 'hrsh7th/cmp-nvim-lua' }, - { 'hrsh7th/cmp-nvim-lsp' }, - { 'hrsh7th/cmp-path' }, - - -- Snippets - { 'L3MON4D3/LuaSnip' }, - { 'saadparwaiz1/cmp_luasnip' }, - }, - } - - -- Function context - use 'nvim-treesitter/nvim-treesitter-context' -end) diff --git a/.config/nvim/lua/mango/remap.lua b/.config/nvim/lua/mango/remap.lua deleted file mode 100644 index a22632e..0000000 --- a/.config/nvim/lua/mango/remap.lua +++ /dev/null @@ -1,54 +0,0 @@ -local lib = require('mango.lib') -local remap = lib.remap - -vim.g.mapleader = ' ' - --- Make adjustments for my custom keyboard layout -remap('nov', '€', '$') - --- Better frame navigation -remap('n', '<C-h>', '<C-w>h') -remap('n', '<C-j>', '<C-w>j') -remap('n', '<C-k>', '<C-w>k') -remap('n', '<C-l>', '<C-w>l') - --- I prefer visual-line mode on ‘V’ -remap('n', 'V', '<C-v>') -remap('n', '<C-v>', 'V') - --- Move selections up and down -remap('v', '<C-k>', ":m '<-2<CR>gv=gv") -remap('v', '<C-j>', ":m '>+1<CR>gv=gv") - --- Don’t move cursor with various commands -remap('n', 'J', 'mzJ`z') -remap('n', '<C-d>', '<C-d>zz') -remap('n', '<C-u>', '<C-u>zz') -remap('n', 'n', 'nzzzv') -remap('n', 'N', 'Nzzzv') - --- Compile code quickly -remap('n', 'M', ':make<CR>') - --- Transpose characters; for some reason it has a noticable delay if I just give --- a string instead of lambda functions -remap('n', '<leader>t', function() vim.cmd.normal('"zx"zp') end) -remap('n', '<leader>T', function() vim.cmd.normal('"zX"zp') end) - --- Open netrw quickly -remap('n', '-', ':Ex<CR>') - --- Open netrw in a vertical- or horizontal split. The split is made manually --- instead of by using :Vexplore or :Sexplore so that it’s made on the right or --- bottom instead of the left or top -remap('n', '–', ':vsplit | Ex<CR>') -remap('n', 'g–', ':split | Ex<CR>') - -remap('n', '<leader>s', function() - vim.cmd('vsplit') - lib.scratch_buffer() -end) -remap('n', '<leader>S', function() - vim.cmd('split') - lib.scratch_buffer() -end) diff --git a/.config/nvim/lua/mango/set.lua b/.config/nvim/lua/mango/set.lua deleted file mode 100644 index 6b92625..0000000 --- a/.config/nvim/lua/mango/set.lua +++ /dev/null @@ -1,72 +0,0 @@ -local lib = require('mango.lib') -local api = vim.api - -local o = vim.opt -local g = vim.g - -local augroup = api.nvim_create_augroup('Mango', { clear = true }) - -o.nu = true -o.relativenumber = true -o.signcolumn = 'no' -o.colorcolumn = '81' - -o.exrc = true -o.secure = true - -g.guifont = { 'Iosevka Smooth Term', ':h16' } - -lib.set_tab_width(4) -o.expandtab = false -o.smartindent = true - -o.wrap = false - -o.swapfile = false -o.backup = false -o.undodir = os.getenv('XDG_STATE_HOME') .. '/nvim/undo' -o.undofile = true - -o.hlsearch = true -o.incsearch = true - -o.termguicolors = true - -o.scrolloff = 8 - -o.isfname:append('@-@') - -o.splitright = true -o.splitbelow = true - --- Better settings for netrw -g.netrw_banner = 0 -g.netrw_bufsettings = 'noma nomod nu nobl nowrap ro' -- Enable line-numbers -g.netrw_list_hide = [[^\(\.\|\.\.\)/\?$,^__pycache__/\?,.*\.\(o\|pyc\)$]] - -vim.cmd [[ set grepprg=rg\ --vimgrep ]] - --- Disable auto commenting -api.nvim_create_autocmd('BufEnter', { - callback = function() - o.formatoptions:remove({ 'c', 'r', 'o' }) - end, - group = augroup, -}) - --- Make buffer auto-reverting work… somehow -vim.cmd([[ - if !exists('g:CheckUpdateStarted') - let g:CheckUpdateStarted = 1 - call timer_start(1000, 'CheckUpdate', {'repeat': -1}) - endif - - function! CheckUpdate(_) - silent! checktime - endfunction -]]) - --- Allow for jumping between these pairs with % -o.matchpairs:append('<:>') -o.matchpairs:append('‘:’') -o.matchpairs:append('“:”') |