Migrate vim init config to neovim
parent
afca2cae5d
commit
85d56f97d1
|
|
@ -1,6 +1,13 @@
|
||||||
require("nixCatsUtils").setup({ non_nix_value = true }) -- https://github.com/BirdeeHub/nixCats-nvim/blob/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example/init.lua
|
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("ftdetect")
|
||||||
require("keymaps")
|
require("keymaps")
|
||||||
require("highlight")
|
require("highlight")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
" General config {{{
|
vim.cmd([[
|
||||||
"
|
|
||||||
" Tip: acronyms for overview, use `:h` for a quick lookup.
|
" Tip: acronyms for overview, use `:h` for a quick lookup.
|
||||||
|
|
||||||
set nocp " Disable vi incompatibility
|
set nocp " Disable vi incompatibility
|
||||||
filetype plugin indent on " Filetype recognition
|
filetype plugin indent on " Filetype recognition
|
||||||
set enc=utf8 " Default to UTF-8 encoding
|
set enc=utf8 " Default to UTF-8 encoding
|
||||||
|
|
@ -28,6 +26,5 @@ set lcs=trail:·,tab:→\ ,nbsp:␣ " Whitespace rendering
|
||||||
set ar " Autoread
|
set ar " Autoread
|
||||||
set spellsuggest+=5 " Limit spell suggestions
|
set spellsuggest+=5 " Limit spell suggestions
|
||||||
set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip
|
set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip
|
||||||
set thesaurus+=~/.vim/thesaurus/mthesaur.txt
|
" set thesaurus+=./thesaurus/mthesaur.txt " FIXME
|
||||||
|
]])
|
||||||
" }}}
|
|
||||||
|
|
@ -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
|
local set = vim.keymap.set
|
||||||
|
|
||||||
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })
|
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
" Plugins {{{
|
vim.cmd([[
|
||||||
|
|
||||||
" Plug setup {{{
|
|
||||||
|
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'machakann/vim-sandwich'
|
Plug 'machakann/vim-sandwich'
|
||||||
Plug 'Shougo/context_filetype.vim'
|
Plug 'Shougo/context_filetype.vim'
|
||||||
|
|
@ -31,4 +28,4 @@ Plug 'goerz/jupytext.vim'
|
||||||
" OpenSCAD
|
" OpenSCAD
|
||||||
Plug 'sirtaj/vim-openscad'
|
Plug 'sirtaj/vim-openscad'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
" }}}
|
]])
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
vim.cmd([[
|
|
||||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
|
||||||
let &packpath = &runtimepath
|
|
||||||
source ~/.vimrc"
|
|
||||||
]])
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
set termguicolors
|
|
||||||
set bg=light
|
|
||||||
hi Normal ctermbg=none guibg=NONE
|
|
||||||
|
|
@ -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>
|
|
||||||
Loading…
Reference in New Issue