chore(vim): Converted some config and remapping to lua
This commit is contained in:
parent
ca2cb0fb11
commit
57e226d2db
7 changed files with 73 additions and 10 deletions
|
@ -20,7 +20,8 @@
|
||||||
-- null2264's NeoVim Config --
|
-- null2264's NeoVim Config --
|
||||||
--========================================--
|
--========================================--
|
||||||
|
|
||||||
require("null")
|
-- TODO: Uncomment once we done migrating
|
||||||
|
-- require("null")
|
||||||
|
|
||||||
-- FIXME: Turn all these to LUA
|
-- FIXME: Turn all these to LUA
|
||||||
vim.cmd("source ~/.config/vim/vim_nix")
|
vim.cmd("source ~/.config/vim/vim_nix")
|
||||||
|
|
6
.config/nvim/lazy-lock.json
Normal file
6
.config/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" },
|
||||||
|
"oil.nvim": { "branch": "master", "commit": "e462a3446505185adf063566f5007771b69027a1" },
|
||||||
|
"vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
require("null.remap")
|
||||||
|
|
||||||
|
local o = vim.opt
|
||||||
|
local g = vim.g
|
||||||
|
|
||||||
|
o.nu = true
|
||||||
|
o.relativenumber = true
|
||||||
|
|
||||||
|
g.mapleader = " "
|
||||||
|
g.guifont = { "Sarasa UI J", ":h16" }
|
||||||
|
|
||||||
|
require("oil").setup()
|
|
@ -1,6 +1,6 @@
|
||||||
-- vim_uni
|
|
||||||
require("null.config")
|
|
||||||
-- vim_plug
|
-- vim_plug
|
||||||
require("null.plug")
|
require("null.plug")
|
||||||
|
-- vim_uni
|
||||||
|
require("null.config")
|
||||||
-- vim_nix
|
-- vim_nix
|
||||||
require("null.nix") -- n*x specific stuff
|
require("null.nix") -- n*x specific stuff
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
{
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
opts = {},
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
},
|
||||||
|
"tpope/vim-commentary", -- shortcut to comment a line
|
||||||
|
})
|
23
.config/nvim/lua/null/remap.lua
Normal file
23
.config/nvim/lua/null/remap.lua
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
-- Loaded by `null.config`
|
||||||
|
local remap = function(mode, key, target, opts)
|
||||||
|
vim.api.nvim_set_keymap(mode, key, target, opts or {
|
||||||
|
noremap = true,
|
||||||
|
silent = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Map Ctrl+U as U so it can be used as redo
|
||||||
|
remap("n", "<C-u>", "U")
|
||||||
|
-- Map U as redo
|
||||||
|
remap("n", "U", "<C-r>")
|
||||||
|
|
||||||
|
-- Yank and Put
|
||||||
|
remap("n", "<C-y>", '"+y')
|
||||||
|
remap("n", "<C-p>", '"+p')
|
||||||
|
remap("n", "<C-Y>", '"+y')
|
||||||
|
remap("n", "<C-P>", '"+p')
|
||||||
|
|
||||||
|
-- Comment a line like how it is on VSC (using vim-commentary)
|
||||||
|
remap("n", "<C-/>", "gcc", { noremap = false })
|
||||||
|
remap("v", "<C-/>", "gc", { noremap = false })
|
||||||
|
remap("i", "<C-/>", "<esc>gcc", { noremap = false })
|
|
@ -6,7 +6,7 @@
|
||||||
" ----- Vim Initial Config
|
" ----- Vim Initial Config
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
set hls
|
set hls
|
||||||
set number relativenumber
|
set number relativenumber " -- converted
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set smartcase
|
set smartcase
|
||||||
set mouse=a
|
set mouse=a
|
||||||
|
@ -24,8 +24,8 @@ set fillchars=eob:\
|
||||||
syntax on
|
syntax on
|
||||||
filetype indent plugin on
|
filetype indent plugin on
|
||||||
map <C-n> :NERDTreeToggle<CR>
|
map <C-n> :NERDTreeToggle<CR>
|
||||||
let mapleader=" "
|
let mapleader=" " " -- converted
|
||||||
set guifont=Iosevka:h15
|
set guifont=Iosevka:h15 " -- converted
|
||||||
|
|
||||||
" ----- Folding stuff
|
" ----- Folding stuff
|
||||||
set foldnestmax=10
|
set foldnestmax=10
|
||||||
|
@ -40,19 +40,19 @@ autocmd FileType python setlocal foldmethod=indent
|
||||||
" Norm but in shortcut
|
" Norm but in shortcut
|
||||||
vnoremap . :normal .<CR>
|
vnoremap . :normal .<CR>
|
||||||
|
|
||||||
" Map ctrl + u as U
|
" Map ctrl + u as U -- converted
|
||||||
noremap <C-u> U
|
noremap <C-u> U
|
||||||
|
|
||||||
" Map U as redo (ctrl + r)
|
" Map U as redo (ctrl + r) -- converted
|
||||||
noremap U <C-r>
|
noremap U <C-r>
|
||||||
|
|
||||||
" Yank and Put to/from clipboard/primary
|
" Yank and Put to/from clipboard/primary -- converted
|
||||||
noremap <C-y> "+y
|
noremap <C-y> "+y
|
||||||
noremap <C-p> "+p
|
noremap <C-p> "+p
|
||||||
noremap <C-Y> "+y
|
noremap <C-Y> "+y
|
||||||
noremap <C-P> "+P
|
noremap <C-P> "+P
|
||||||
|
|
||||||
" Shortcut to comment a line
|
" Shortcut to comment a line -- converted
|
||||||
map <C-/> gcc
|
map <C-/> gcc
|
||||||
vmap <C-/> gc
|
vmap <C-/> gc
|
||||||
imap <C-/> <esc>gc
|
imap <C-/> <esc>gc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue