Compare commits

...

2 commits

Author SHA1 Message Date
5b2a2b4dff Starting to split the config 2025-01-17 09:33:04 -05:00
dbc4424893 If-block for non-VSCode usage 2025-01-16 20:38:22 -05:00
3 changed files with 66 additions and 62 deletions

View file

@ -1,62 +1,63 @@
HOME = os.getenv("HOME") HOME = os.getenv("HOME")
-- Configure the clipboard to access the "+ and "* registers if not vim.g.vscode then
-- N.B. JavaScript copy buttons on the web do not necessarily work as expected -- Configure the clipboard to access the "+ and "* registers
vim.opt.clipboard = "unnamedplus,unnamed" -- N.B. JavaScript copy buttons on the web do not necessarily work as expected
vim.opt.clipboard = "unnamedplus,unnamed"
-- Spaces indentation -- Spaces indentation
vim.opt.expandtab = true -- converts tabs to spaces vim.opt.expandtab = true -- converts tabs to spaces
vim.opt.tabstop = 4 -- tab equals 4 spaces vim.opt.tabstop = 4 -- tab equals 4 spaces
vim.opt.shiftwidth = 4 -- indent size in characters vim.opt.shiftwidth = 4 -- indent size in characters
-- Show whitespace (:list) -- Show whitespace (:list)
vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·" vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·"
-- Show line numbers -- Show line numbers
vim.opt.number = true vim.opt.number = true
-- Vertically splitting a window (:vsplit) places new window to the right -- Vertically splitting a window (:vsplit) places new window to the right
vim.opt.splitright = true vim.opt.splitright = true
-- Highlight cursor line -- Highlight cursor line
vim.opt.cursorline = true vim.opt.cursorline = true
-- Enable folding -- Enable folding
vim.opt.foldmethod = "syntax" vim.opt.foldmethod = "syntax"
vim.opt.foldlevel = 5 vim.opt.foldlevel = 5
-- Enable 24-bit RGB color in the TUI -- Enable 24-bit RGB color in the TUI
vim.opt.termguicolors = true vim.opt.termguicolors = true
-- Minimal number of lines kept above and below the cursor -- Minimal number of lines kept above and below the cursor
vim.opt.scrolloff = 5 vim.opt.scrolloff = 5
-- Turn off highlight search -- Turn off highlight search
vim.opt.hlsearch = false vim.opt.hlsearch = false
-- Temporary file locations -- Temporary file locations
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//" vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//" vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
-- netrw -- netrw
-- This is the workspace file explorer -- This is the workspace file explorer
vim.g.netrw_winsize = 25 -- width of the file explorer vim.g.netrw_winsize = 25 -- width of the file explorer
vim.g.netrw_liststyle = 3 -- tree style listing vim.g.netrw_liststyle = 3 -- tree style listing
-- Sane vim split naviagation (via Gaslight blog) -- Sane vim split naviagation (via Gaslight blog)
vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true, desc = 'Go to window below' }) vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true, desc = 'Go to window above' }) vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to the left' }) vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to the left' })
-- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`. -- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`.
-- TODO: This seems not to work for netrw. -- TODO: This seems not to work for netrw.
vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' }) vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' }) vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go to window above' }) vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = 'Go to window to the left' }) vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = 'Go to window to the left' })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' }) vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set( vim.keymap.set(
{ "n", "t" }, { "n", "t" },
"<leader>z", "<leader>z",
function() function()
@ -66,17 +67,18 @@ vim.keymap.set(
end end
end, end,
{ desc = "Revert window layout" } { desc = "Revert window layout" }
) )
local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true }) local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true })
vim.api.nvim_create_autocmd( vim.api.nvim_create_autocmd(
{ "TermOpen", "TermEnter" }, { "TermOpen", "TermEnter" },
{ {
group = terminalgroup, group = terminalgroup,
pattern = "*", pattern = "*",
command = "set nonumber" command = "set nonumber"
} }
) )
end
-- lazy.nvim -- lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

2
nvim/lua/plugins.lua Normal file
View file

@ -0,0 +1,2 @@
return {
}