add some basic plugins and keymap
This commit is contained in:
23
lua/config/clipboard.lua
Normal file
23
lua/config/clipboard.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
local function paste()
|
||||
return {
|
||||
vim.fn.split(vim.fn.getreg(""), "\n"),
|
||||
vim.fn.getregtype(""),
|
||||
}
|
||||
end
|
||||
|
||||
vim.g.clipboard = {
|
||||
name = "OSC 52",
|
||||
copy = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
},
|
||||
paste = {
|
||||
["+"] = paste,
|
||||
["*"] = paste,
|
||||
},
|
||||
}
|
||||
|
||||
vim.opt.clipboard:append { 'unnamed', 'unnamedplus' }
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
|
||||
local km = vim.keymap.set
|
||||
|
||||
--remaps
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- oil
|
||||
vim.keymap.set('n', "-", "<cmd>Oil --float<CR>", { desc ="Enter file explorer (Oil)" })
|
||||
|
||||
vim.keymap.set('n', "w", "<cmd>w<CR>", { desc = "Save" } )
|
||||
@@ -8,6 +16,12 @@ vim.keymap.set('n', "<leader>wq", "<cmd>wq<CR>", { desc = "Save and quit" } )
|
||||
vim.keymap.set('n', "<leader>qq", "<cmd>q!<CR>", { desc = "Force to quit without saving" } )
|
||||
|
||||
|
||||
-- TERMINAL
|
||||
-- exit t mode
|
||||
km("t", "<Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode"})
|
||||
km("n", "<leader>t" , "<cmd>term<CR>", { desc = "Create a terminal" } )
|
||||
|
||||
|
||||
-- todo: this is not robust... add autocompletion and verify that file exists
|
||||
vim.keymap.set("n", "<leader>e", function()
|
||||
local file_name = vim.fn.input("Open file: ")
|
||||
@@ -16,11 +30,14 @@ vim.keymap.set("n", "<leader>e", function()
|
||||
end
|
||||
end, { desc = "edit a file"})
|
||||
|
||||
-- BUFFERS navigation and manipulation
|
||||
vim.keymap.set("n","<leader>ls", "<cmd>ls<CR>", { desc = "list buffers" })
|
||||
vim.keymap.set("n","<leader>f", "<cmd>bnext<CR>", { desc = "goto next buffers" })
|
||||
vim.keymap.set("n","<leader>d", "<cmd>bprevious<CR>", { desc = "goto previous buffers" })
|
||||
vim.keymap.set("n","<leader>c", "<cmd>bd<CR>", { desc = "close buffers" })
|
||||
|
||||
|
||||
-- CUSTOM HELP FILES
|
||||
vim.keymap.set("n", "<leader>h", function()
|
||||
local config_path = vim.fn.stdpath('config')
|
||||
local readme_path = config_path .. '/CHEATSHEET.md'
|
||||
|
||||
@@ -18,8 +18,6 @@ vim.opt.rtp:prepend(lazypath)
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
@@ -34,5 +32,3 @@ require("lazy").setup({
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
require("config.keymap")
|
||||
require("config.options")
|
||||
|
||||
@@ -22,5 +22,23 @@ vim.o.signcolumn = "yes"
|
||||
vim.o.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
-- Set options
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.mouse = 'a'
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.wrap = true
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.updatetime = 250
|
||||
vim.opt.timeoutlen = 300
|
||||
vim.opt.undofile = true
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
]]
|
||||
|
||||
Reference in New Issue
Block a user