add nvim configs
This commit is contained in:
52
.config/nvim/lua/plug_init/vim_init.lua
Normal file
52
.config/nvim/lua/plug_init/vim_init.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
vim.opt.compatible = false
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.incsearch = false
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.expandtab = true -- spaces not tabs
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.number = true
|
||||
vim.opt.wildmode = "longest,list"
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.ttyfast = true
|
||||
vim.opt.scrolloff = 5
|
||||
vim.opt.wrap = false
|
||||
vim.opt.mouse = ""
|
||||
vim.opt.termguicolors = true -- enable truecolor
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undodir = os.getenv("HOME").."/.local/share/nvim/undodir"
|
||||
vim.opt.updatetime = 50
|
||||
vim.opt.colorcolumn = "79"
|
||||
vim.opt.cmdheight = 0 -- remove the last interface line under statusline
|
||||
---
|
||||
vim.g.netrw_preview = 1
|
||||
vim.g.netrw_liststyle = 3
|
||||
vim.g.netrw_winsize = 25
|
||||
--
|
||||
--These will:
|
||||
--
|
||||
-- 1. Make vertical splitting the default for previewing files
|
||||
-- 2. Make the default listing style "tree"
|
||||
-- 3. When a vertical preview window is opened, the directory listing
|
||||
-- will use only 30% of the columns available; the rest of the window
|
||||
-- is used for the preview window.
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- move highlighted lines up and down, automatic indentation
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- replace highlighted area without adding to register
|
||||
vim.keymap.set("x", "<leader>p", "\"_dP")
|
||||
|
||||
-- copy to system clipboard
|
||||
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||
vim.keymap.set("v", "<leader>y", "\"+y")
|
||||
vim.keymap.set("n", "<leader>Y", "\"+Y")
|
||||
|
||||
-- open side panel explorer
|
||||
vim.keymap.set("n", "<leader>e", ":Lexplore<CR>")
|
||||
Reference in New Issue
Block a user