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
|
@ -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
|
||||
require("null.plug")
|
||||
-- vim_uni
|
||||
require("null.config")
|
||||
-- vim_nix
|
||||
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 })
|
Loading…
Add table
Add a link
Reference in a new issue