Split neovim for neatness and ease of use.
This commit is contained in:
parent
8f1e635b23
commit
5faac9379b
|
|
@ -1,48 +1,33 @@
|
||||||
|
local map = vim.keymap.set
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.termguicolors = true
|
vim.g.termguicolors = true -- Enable 24-bit RGB colors
|
||||||
vim.o.path = "**"
|
vim.o.nu = true -- Show line numbers
|
||||||
vim.o.nu = true
|
vim.o.cursorline = true -- Highlight the line where the cursor is
|
||||||
vim.o.cursorline = true
|
vim.o.wrap = false -- Don't wrap long lines to the next line
|
||||||
vim.o.expandtab = true
|
vim.o.list = true -- Show invisible characters (tabs, trailing spaces)
|
||||||
vim.o.tabstop = 4
|
vim.o.scrolloff = 8 -- Keep 8 lines above/below cursor when scrolling
|
||||||
vim.o.shiftwidth = 4
|
vim.o.winborder = 'rounded' -- Use rounded borders for floating windows
|
||||||
vim.o.ignorecase = true
|
vim.o.ignorecase = true -- Ignore case in search patterns
|
||||||
vim.o.hlsearch = true
|
vim.o.smartcase = true -- ...unless search contains an uppercase letter
|
||||||
vim.o.incsearch = true
|
vim.o.hlsearch = true -- Keep search results highlighted
|
||||||
vim.o.swapfile = false
|
vim.o.incsearch = true -- Show search results as you type
|
||||||
vim.o.backup = false
|
vim.o.path = "**" -- Search down into subdirectories (classic Vim)
|
||||||
vim.o.wrap = false
|
vim.o.expandtab = true -- Use spaces instead of tabs
|
||||||
vim.o.undofile = true
|
vim.o.tabstop = 4 -- 1 tab = 4 spaces
|
||||||
vim.o.list = true
|
vim.o.shiftwidth = 4 -- Indentation amount for >> and << commands
|
||||||
vim.o.splitright = true
|
vim.o.swapfile = false -- Disable creation of .swp files
|
||||||
vim.o.splitbelow = true
|
vim.o.backup = false -- Disable backup files
|
||||||
vim.o.winborder = 'rounded'
|
vim.o.undofile = true -- Save undo history to a file
|
||||||
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
|
vim.o.splitright = true -- Open vertical splits to the right
|
||||||
vim.g.gutentags_cache_dir = os.getenv("HOME") .. "/.cache/nvim/tags"
|
vim.o.splitbelow = true -- Open horizontal splits below
|
||||||
|
vim.o.timeoutlen = 300 -- Time (ms) to wait for a mapped sequence to complete
|
||||||
vim.opt.clipboard = "unnamedplus"
|
vim.opt.clipboard = "unnamedplus"
|
||||||
vim.o.completeopt = 'menuone,noselect'
|
vim.o.completeopt = 'menuone,noselect'
|
||||||
vim.cmd(":colorscheme retrobox")
|
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
|
||||||
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
|
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
|
||||||
vim.lsp.enable({ "gopls", "gdscript" })
|
vim.lsp.enable({ "gopls", "gdscript" })
|
||||||
|
vim.cmd(":colorscheme retrobox")
|
||||||
|
|
||||||
vim.pack.add({
|
|
||||||
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
|
||||||
{ src = "https://github.com/tribela/transparent.nvim" },
|
|
||||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
|
||||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
|
|
||||||
{ src="https://github.com/folke/trouble.nvim" }
|
|
||||||
})
|
|
||||||
require("fzf-lua").setup()
|
|
||||||
require("trouble").setup()
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = '*',
|
|
||||||
callback = function()
|
|
||||||
pcall(vim.treesitter.start)
|
|
||||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
local map = vim.keymap.set
|
|
||||||
map({"t", "n"}, "<C-h>", "<C-\\><C-n><C-w><C-h>")
|
map({"t", "n"}, "<C-h>", "<C-\\><C-n><C-w><C-h>")
|
||||||
map({"t", "n"}, "<C-j>", "<C-\\><C-n><C-w><C-j>")
|
map({"t", "n"}, "<C-j>", "<C-\\><C-n><C-w><C-j>")
|
||||||
map({"t", "n"}, "<C-k>", "<C-\\><C-n><C-w><C-k>")
|
map({"t", "n"}, "<C-k>", "<C-\\><C-n><C-w><C-k>")
|
||||||
|
|
@ -55,16 +40,10 @@ map("v", "K", ":m '<-2<CR>gv=gv")
|
||||||
map("v", "<S-Tab>", "<gv")
|
map("v", "<S-Tab>", "<gv")
|
||||||
map("v", "<Tab>" , ">gv")
|
map("v", "<Tab>" , ">gv")
|
||||||
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
|
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
|
||||||
map("n", "<leader>p", "<cmd>b#<CR>")
|
map("n", "<leader>p", ":b#<CR>")
|
||||||
map("n", "<leader>e", ":Ex<CR>")
|
map("n", "<leader>e", ":Ex<CR>")
|
||||||
map("n", "<leader>c", ":bd<CR>")
|
map("n", "<leader>c", ":bd<CR>")
|
||||||
map("n", "<leader>ff", ":lua FzfLua.files()<CR>")
|
|
||||||
map("n", "<leader>fo", ":lua FzfLua.buffers()<CR>")
|
|
||||||
map("n", "<leader>sp", ":lua FzfLua.grep_project()<CR>")
|
|
||||||
map("n", "<leader>sf", ":lua FzfLua.grep_curbuf()<CR>")
|
|
||||||
map("n", "<leader>sw", ":lua FzfLua.grep_cword()<CR>")
|
|
||||||
map("n", "<leader>sh", ":lua FzfLua.help_tags()<CR>")
|
|
||||||
map("n", "<leader>pa", ":lua FzfLua.lsp_code_actions()<CR>")
|
|
||||||
map('n', '<leader>pp', ":Trouble diagnostics toggle<CR>")
|
|
||||||
map("n", "<leader>1", ":vsplit | vertical resize 95 | terminal<CR>a")
|
map("n", "<leader>1", ":vsplit | vertical resize 95 | terminal<CR>a")
|
||||||
map("n", "<leader>2", ":split | horizontal resize 25 | terminal<CR>a")
|
map("n", "<leader>2", ":split | horizontal resize 25 | terminal<CR>a")
|
||||||
|
|
||||||
|
require("plugins")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
||||||
|
{ src = "https://github.com/tribela/transparent.nvim" },
|
||||||
|
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||||
|
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
|
||||||
|
{ src="https://github.com/folke/trouble.nvim" },
|
||||||
|
{ src="https://github.com/stevearc/oil.nvim" }
|
||||||
|
})
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
local acmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
acmd('FileType', {
|
||||||
|
pattern = '*',
|
||||||
|
callback = function()
|
||||||
|
pcall(vim.treesitter.start)
|
||||||
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
require("fzf-lua").setup()
|
||||||
|
map("n", "<leader>ff", ":lua FzfLua.files()<CR>")
|
||||||
|
map("n", "<leader>fo", ":lua FzfLua.buffers()<CR>")
|
||||||
|
map("n", "<leader>sp", ":lua FzfLua.grep_project()<CR>")
|
||||||
|
map("n", "<leader>sf", ":lua FzfLua.grep_curbuf()<CR>")
|
||||||
|
map("n", "<leader>sw", ":lua FzfLua.grep_cword()<CR>")
|
||||||
|
map("n", "<leader>sh", ":lua FzfLua.help_tags()<CR>")
|
||||||
|
|
||||||
|
require("trouble").setup()
|
||||||
|
map("n", "<leader>pa", ":lua FzfLua.lsp_code_actions()<CR>")
|
||||||
|
map('n', '<leader>pp', ":Trouble diagnostics toggle<CR>")
|
||||||
|
|
||||||
|
require("oil").setup({
|
||||||
|
keymaps = {
|
||||||
|
["q"] = { "actions.close", mode = "n" },
|
||||||
|
["h"] = "actions.parent",
|
||||||
|
["l"] = "actions.select",
|
||||||
|
["<C-s>"] = false,
|
||||||
|
["<C-h>"] = false,
|
||||||
|
["gh"] = "actions.toggle_hidden",
|
||||||
|
},
|
||||||
|
view_options = {
|
||||||
|
show_hidden = false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
map("n", "<leader>e", ":Oil " .. vim.fn.getcwd() .. "<CR>")
|
||||||
Loading…
Reference in New Issue