add some basic plugins and keymap
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Neovim cheatsheet for this setup
|
||||
|
||||
## Frequent use cases
|
||||
|
||||
### Files navigation
|
||||
|
||||
|
||||
## Save and exit
|
||||
|
||||
|
||||
22
README.md
22
README.md
@@ -1,19 +1,25 @@
|
||||
# Basic neovim configuration
|
||||
|
||||
Focused on cognitive load reduction and productivity.
|
||||
|
||||
## Helps mechanisms
|
||||
|
||||
To open [CHEATSHEET.md](./CHEATSHEET.md): `<leader>h`.
|
||||
To open [README.md](./README.md): `<leader>hr`
|
||||
|
||||
|
||||
## Used package
|
||||
## Selected packages
|
||||
|
||||
- [x] kanagawa: color schema
|
||||
- [x] oil: files manager
|
||||
- [x] mini-statusline
|
||||
|
||||
## References
|
||||
|
||||
- https://www.youtube.com/watch?v=g1gyYttzxcI
|
||||
- kanagawa: color schema
|
||||
- oil: files manager
|
||||
- mini-statusline
|
||||
- vim-sleuth: autodetect file indentation rules/policies
|
||||
- showkeys: show typped keys
|
||||
- smear-cursor: visual cue of motion
|
||||
|
||||
### mainstream packages
|
||||
|
||||
- lazy
|
||||
- treesitter
|
||||
- telescope
|
||||
|
||||
|
||||
6
REFERENCES.md
Normal file
6
REFERENCES.md
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
## References
|
||||
|
||||
- https://www.youtube.com/watch?v=g1gyYttzxcI
|
||||
|
||||
|
||||
7
TODO.md
Normal file
7
TODO.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Problems and missing features
|
||||
|
||||
|
||||
## Files browsing
|
||||
|
||||
- [ ] open oil in the current file directory
|
||||
- [ ] see the current path of oil
|
||||
6
init.lua
6
init.lua
@@ -1,2 +1,6 @@
|
||||
require("config.lazy")
|
||||
|
||||
require("config.keymap")
|
||||
require("config.options")
|
||||
require("config.lazy")
|
||||
require("config.clipboard")
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
|
||||
"mini.statusline": { "branch": "main", "commit": "e331175f10d9f400b42523b3890841aba202ce16" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }
|
||||
"showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" },
|
||||
"smear-cursor.nvim": { "branch": "main", "commit": "abfa5835920b1d76c0e24e1465a618ad914be90a" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"zenbones.nvim": { "branch": "main", "commit": "a934bc07d2ed4a98b74526c172d7f043736d8935" }
|
||||
}
|
||||
|
||||
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"
|
||||
]]
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
return {
|
||||
"rebelot/kanagawa.nvim", opt = {},
|
||||
config = function()
|
||||
require("kanagawa").setup({
|
||||
compile = true,
|
||||
|
||||
transparent = true
|
||||
});
|
||||
vim.cmd("colorscheme kanagawa");
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd("KanagawaCompile"); -- this line fail at first install
|
||||
end,
|
||||
require("kanagawa").setup({
|
||||
compile = true,
|
||||
transparent = true
|
||||
});
|
||||
vim.cmd("colorscheme kanagawa");
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd("KanagawaCompile"); -- this line fail at first install
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -8,4 +8,11 @@ return {
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("oil").setup({
|
||||
view_options = {
|
||||
show_hidden = true;
|
||||
},
|
||||
});
|
||||
end
|
||||
}
|
||||
|
||||
10
lua/plugins/showkeys.lua
Normal file
10
lua/plugins/showkeys.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"nvzone/showkeys",
|
||||
enabled = false,
|
||||
cmd = "ShowkeysToggle",
|
||||
opts = {
|
||||
timeout = 1,
|
||||
maxkeys = 5,
|
||||
-- more opts
|
||||
}
|
||||
}
|
||||
4
lua/plugins/smear-cursor.lua
Normal file
4
lua/plugins/smear-cursor.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"sphamba/smear-cursor.nvim",
|
||||
opts = {},
|
||||
}
|
||||
33
lua/plugins/treesitter.lua
Normal file
33
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
-- treesitter
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
-- treesitter config
|
||||
local config = require("nvim-treesitter.configs")
|
||||
config.setup({
|
||||
ignore_install = {},
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"go",
|
||||
"rust",
|
||||
"c",
|
||||
"lua",
|
||||
"python",
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"sql",
|
||||
"markdown",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
modules = {},
|
||||
sync_install = true,
|
||||
auto_install = true,
|
||||
})
|
||||
end
|
||||
}
|
||||
19
lua/plugins/zenbone.lua
Normal file
19
lua/plugins/zenbone.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"zenbones-theme/zenbones.nvim",
|
||||
-- Optionally install Lush. Allows for more configuration or extending the colorscheme
|
||||
-- If you don't want to install lush, make sure to set g:zenbones_compat = 1
|
||||
-- In Vim, compat mode is turned on as Lush only works in Neovim.
|
||||
-- dependencies = "rktjmp/lush.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- set g:zenbones_compat = 1
|
||||
vim.g.zenbones_compat = 1
|
||||
end
|
||||
-- you can set set configuration options here
|
||||
-- config = function()
|
||||
-- vim.g.zenbones_darken_comments = 45
|
||||
-- vim.cmd.colorscheme('zenbones')
|
||||
-- end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user