Migrate vim init config to neovim

main
Hektor Misplon 2025-10-19 20:14:10 +02:00
parent afca2cae5d
commit 85d56f97d1
8 changed files with 60 additions and 68 deletions

View File

@ -1,6 +1,13 @@
require("nixCatsUtils").setup({ non_nix_value = true }) -- https://github.com/BirdeeHub/nixCats-nvim/blob/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example/init.lua
require("vim")
vim.cmd([[
set termguicolors
set bg=light
hi Normal ctermbg=none guibg=NONE
]])
require("base")
require("plug")
require("ftdetect")
require("keymaps")
require("highlight")

View File

@ -1,7 +1,5 @@
" General config {{{
"
vim.cmd([[
" Tip: acronyms for overview, use `:h` for a quick lookup.
set nocp " Disable vi incompatibility
filetype plugin indent on " Filetype recognition
set enc=utf8 " Default to UTF-8 encoding
@ -28,6 +26,5 @@ set lcs=trail:·,tab:→\ ,nbsp:␣ " Whitespace rendering
set ar " Autoread
set spellsuggest+=5 " Limit spell suggestions
set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip
set thesaurus+=~/.vim/thesaurus/mthesaur.txt
" }}}
" set thesaurus+=./thesaurus/mthesaur.txt " FIXME
]])

View File

@ -1,3 +1,50 @@
vim.cmd([[
" Leader keys
let mapleader = " "
let maplocalleader = ";"
" Splits & navigation
nm s <c-w> " Split horizontal
nm ss :sp<CR><c-w>w| " Split horizontal
nm sv :vs<CR><c-w>w| " Split vertical
nm sw <c-w>w| " Navigate splits
nm sh <c-w>h| "
nm sj <c-w>j| "
nm sk <c-w>k| "
nm sl <c-w>l| "
nn sH <c-w>8<| " Resize splits
nn sJ <c-w>8-| "
nn sK <c-w>8+| "
nn sL <c-w>8>| "
nn s= <c-w>=| " Equalize splits
" Open
nn sb :Lex<cr>| " File tree
nn <leader><leader> :noh<cr> |"
nn <leader>t :term<cr>| " Open terminal
" Remaps
ino <nowait> jj <esc>| " Normal now
nn <left> <nop>| " Hard mode
nn <down> <nop>| " "
nn <up> <nop>| " "
nn <right> <nop>| " "
ino <left> <nop>| " "
ino <down> <nop>| " "
ino <up> <nop>| " "
ino <right> <nop>| " "
" Search
nn <c-_> :noh<cr>| " map 'ctrl + /'
" Line numbers
nn <leader>n :set nu! rnu!<cr>
" Vim configuration
nn <leader>ec :vs $MYVIMRC<cr>
nn <leader>so :so %<cr>
]])
local set = vim.keymap.set
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })

View File

@ -1,7 +1,4 @@
" Plugins {{{
" Plug setup {{{
vim.cmd([[
call plug#begin()
Plug 'machakann/vim-sandwich'
Plug 'Shougo/context_filetype.vim'
@ -31,4 +28,4 @@ Plug 'goerz/jupytext.vim'
" OpenSCAD
Plug 'sirtaj/vim-openscad'
call plug#end()
" }}}
]])

View File

@ -1,5 +0,0 @@
vim.cmd([[
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc"
]])

View File

@ -1,3 +0,0 @@
set termguicolors
set bg=light
hi Normal ctermbg=none guibg=NONE

View File

@ -1,44 +0,0 @@
" Leader keys
let mapleader = " "
let maplocalleader = ";"
" Splits & navigation
nm s <c-w> " Split horizontal
nm ss :sp<CR><c-w>w| " Split horizontal
nm sv :vs<CR><c-w>w| " Split vertical
nm sw <c-w>w| " Navigate splits
nm sh <c-w>h| "
nm sj <c-w>j| "
nm sk <c-w>k| "
nm sl <c-w>l| "
nn sH <c-w>8<| " Resize splits
nn sJ <c-w>8-| "
nn sK <c-w>8+| "
nn sL <c-w>8>| "
nn s= <c-w>=| " Equalize splits
" Open
nn sb :Lex<cr>| " File tree
nn <leader><leader> :noh<cr> |"
nn <leader>t :term<cr>| " Open terminal
" Remaps
ino <nowait> jj <esc>| " Normal now
nn <left> <nop>| " Hard mode
nn <down> <nop>| " "
nn <up> <nop>| " "
nn <right> <nop>| " "
ino <left> <nop>| " "
ino <down> <nop>| " "
ino <up> <nop>| " "
ino <right> <nop>| " "
" Search
nn <c-_> :noh<cr>| " map 'ctrl + /'
" Line numbers
nn <leader>n :set nu! rnu!<cr>
" Vim configuration
nn <leader>ec :vs $MYVIMRC<cr>
nn <leader>so :so %<cr>

4
.vimrc
View File

@ -1,4 +0,0 @@
source ~/.vim/init/base.vim
source ~/.vim/init/mappings.vim
source ~/.vim/init/plugins.vim
source ~/.vim/init/colors.vim