Added NeoVim config files
This commit is contained in:
4
files/system/etc/xdg/nvim/init.lua
Normal file
4
files/system/etc/xdg/nvim/init.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env lua
|
||||
require("options")
|
||||
require("keymaps")
|
||||
require("config.lazy")
|
34
files/system/etc/xdg/nvim/lua/config/lazy.lua
Normal file
34
files/system/etc/xdg/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
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({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
31
files/system/etc/xdg/nvim/lua/keymaps.lua
Normal file
31
files/system/etc/xdg/nvim/lua/keymaps.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
-- define comon options
|
||||
local opts = {
|
||||
noremap = true, -- non-recursive
|
||||
silent = true, -- do not show message
|
||||
}
|
||||
|
||||
-----------------
|
||||
-- Normal mode --
|
||||
-----------------
|
||||
|
||||
-- check `:h vim.map.set()` to get better idea of what this does
|
||||
-- Better window navigation
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h', opts)
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j', opts)
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k', opts)
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l', opts)
|
||||
|
||||
-- Resize with arrows
|
||||
-- delta: 2 lines
|
||||
vim.keymap.set('n', '<C-Up>', ':resize -2<CR>', opts)
|
||||
vim.keymap.set('n', '<C-Down>', ':resize +2<CR>', opts)
|
||||
vim.keymap.set('n', '<C-Left>', ':vertical resize -2<CR>', opts)
|
||||
vim.keymap.set('n', '<C-Right>', ':vertical resize +2<CR>', opts)
|
||||
|
||||
-----------------
|
||||
-- Visual mode --
|
||||
-----------------
|
||||
|
||||
-- start visual mode with same area as previous area and same mode
|
||||
vim.keymap.set('v', '<', '<gv', opts)
|
||||
vim.keymap.set('v', '>', '>gv', opts)
|
25
files/system/etc/xdg/nvim/lua/options.lua
Normal file
25
files/system/etc/xdg/nvim/lua/options.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
-- use `:h <option>` to figure out meaning
|
||||
vim.opt.clipboard = "unnamedplus" -- use system keyboard
|
||||
vim.opt.completeopt = { "menu", "noinsert", "noselect" }
|
||||
vim.opt.mouse = "a" -- supposedly to allow the mouse to be used in nvim
|
||||
|
||||
-- Tab settings
|
||||
vim.opt.tabstop = 4 -- set number of visual spaces per \t (Tab)
|
||||
vim.opt.softtabstop = 4 -- set number of space in tab when editing
|
||||
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
|
||||
vim.opt.expandtab = false -- for python apparently, treat tabs as spaces
|
||||
|
||||
-- UI config
|
||||
vim.opt.number = true -- show the absolute number
|
||||
vim.opt.relativenumber = true -- to add numbers to each line on the left side (line numbers?)
|
||||
vim.opt.cursorline = true -- highlights the line where the cursor is
|
||||
vim.opt.splitbelow = true -- sets new splits to be opened below
|
||||
vim.opt.splitright = true -- sets new splits to be opened to the right
|
||||
vim.opt.termguicolors = true -- enables 24-bit RGB color in Terminal UI
|
||||
-- vim.opt.showmode = false -- removes the --INSERT-- like UI at the bottom
|
||||
|
||||
-- Search settings
|
||||
vim.opt.incsearch = true -- search as characters are entered
|
||||
--vim.opt.hlsearch = false -- do not highlight matches
|
||||
vim.opt.ignorecase = true -- ignore cases by default
|
||||
vim.opt.smartcase = true -- when capitalized, be case sensitive
|
24
files/system/etc/xdg/nvim/lua/plugins/init.lua
Normal file
24
files/system/etc/xdg/nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
import = "lazyvim.plugins",
|
||||
opts = {
|
||||
colorscheme = function()
|
||||
local tokyonight = require("tokyonight")
|
||||
tokyonight.setup({
|
||||
style = "night",
|
||||
on_highlights = function(hl)
|
||||
hl.LineNrAbove = {
|
||||
fg = "#6ab8ff",
|
||||
}
|
||||
hl.LineNrBelow = {
|
||||
fg = "#ff6188",
|
||||
}
|
||||
end,
|
||||
on_colors = function() end,
|
||||
})
|
||||
tokyonight.load()
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
12
files/system/etc/xdg/nvim/lua/plugins/neo-tree.lua
Normal file
12
files/system/etc/xdg/nvim/lua/plugins/neo-tree.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
},
|
||||
},
|
||||
}
|
14
files/system/etc/xdg/nvim/lua/plugins/remove-bufferline.lua
Normal file
14
files/system/etc/xdg/nvim/lua/plugins/remove-bufferline.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
{
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
opts = {
|
||||
options = {
|
||||
mode = "tabs",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
18
files/system/etc/xdg/nvim/lua/plugins/treesitter.lua
Normal file
18
files/system/etc/xdg/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local plugin = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })()
|
||||
end,
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
return { plugin }
|
5
files/system/etc/xdg/nvim/lua/plugins/yuck.lua
Normal file
5
files/system/etc/xdg/nvim/lua/plugins/yuck.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
{
|
||||
"elkowar/yuck.vim",
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user