Compare commits
2 commits
main
...
vscode-com
Author | SHA1 | Date | |
---|---|---|---|
5b2a2b4dff | |||
dbc4424893 |
3 changed files with 66 additions and 62 deletions
|
@ -1,82 +1,84 @@
|
|||
HOME = os.getenv("HOME")
|
||||
|
||||
-- Configure the clipboard to access the "+ and "* registers
|
||||
-- N.B. JavaScript copy buttons on the web do not necessarily work as expected
|
||||
vim.opt.clipboard = "unnamedplus,unnamed"
|
||||
if not vim.g.vscode then
|
||||
-- Configure the clipboard to access the "+ and "* registers
|
||||
-- N.B. JavaScript copy buttons on the web do not necessarily work as expected
|
||||
vim.opt.clipboard = "unnamedplus,unnamed"
|
||||
|
||||
-- Spaces indentation
|
||||
vim.opt.expandtab = true -- converts tabs to spaces
|
||||
vim.opt.tabstop = 4 -- tab equals 4 spaces
|
||||
vim.opt.shiftwidth = 4 -- indent size in characters
|
||||
-- Spaces indentation
|
||||
vim.opt.expandtab = true -- converts tabs to spaces
|
||||
vim.opt.tabstop = 4 -- tab equals 4 spaces
|
||||
vim.opt.shiftwidth = 4 -- indent size in characters
|
||||
|
||||
-- Show whitespace (:list)
|
||||
vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·"
|
||||
-- Show whitespace (:list)
|
||||
vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·"
|
||||
|
||||
-- Show line numbers
|
||||
vim.opt.number = true
|
||||
-- Show line numbers
|
||||
vim.opt.number = true
|
||||
|
||||
-- Vertically splitting a window (:vsplit) places new window to the right
|
||||
vim.opt.splitright = true
|
||||
-- Vertically splitting a window (:vsplit) places new window to the right
|
||||
vim.opt.splitright = true
|
||||
|
||||
-- Highlight cursor line
|
||||
vim.opt.cursorline = true
|
||||
-- Highlight cursor line
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- Enable folding
|
||||
vim.opt.foldmethod = "syntax"
|
||||
vim.opt.foldlevel = 5
|
||||
-- Enable folding
|
||||
vim.opt.foldmethod = "syntax"
|
||||
vim.opt.foldlevel = 5
|
||||
|
||||
-- Enable 24-bit RGB color in the TUI
|
||||
vim.opt.termguicolors = true
|
||||
-- Enable 24-bit RGB color in the TUI
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- Minimal number of lines kept above and below the cursor
|
||||
vim.opt.scrolloff = 5
|
||||
-- Minimal number of lines kept above and below the cursor
|
||||
vim.opt.scrolloff = 5
|
||||
|
||||
-- Turn off highlight search
|
||||
vim.opt.hlsearch = false
|
||||
-- Turn off highlight search
|
||||
vim.opt.hlsearch = false
|
||||
|
||||
-- Temporary file locations
|
||||
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
|
||||
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
|
||||
-- Temporary file locations
|
||||
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
|
||||
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
|
||||
|
||||
-- netrw
|
||||
-- This is the workspace file explorer
|
||||
vim.g.netrw_winsize = 25 -- width of the file explorer
|
||||
vim.g.netrw_liststyle = 3 -- tree style listing
|
||||
-- netrw
|
||||
-- This is the workspace file explorer
|
||||
vim.g.netrw_winsize = 25 -- width of the file explorer
|
||||
vim.g.netrw_liststyle = 3 -- tree style listing
|
||||
|
||||
-- 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-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' })
|
||||
-- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`.
|
||||
-- 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' })
|
||||
-- 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-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' })
|
||||
-- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`.
|
||||
-- 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("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-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-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-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(
|
||||
{ "n", "t" },
|
||||
"<leader>z",
|
||||
function()
|
||||
-- This restores the UI to the saved layout 'idelayout' (if it exists)
|
||||
if vim.fn.exists("idelayout") ~= 0 then
|
||||
vim.cmd("exec idelayout")
|
||||
end
|
||||
end,
|
||||
{ desc = "Revert window layout" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
{ "n", "t" },
|
||||
"<leader>z",
|
||||
function()
|
||||
-- This restores the UI to the saved layout 'idelayout' (if it exists)
|
||||
if vim.fn.exists("idelayout") ~= 0 then
|
||||
vim.cmd("exec idelayout")
|
||||
end
|
||||
end,
|
||||
{ desc = "Revert window layout" }
|
||||
)
|
||||
|
||||
local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true })
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ "TermOpen", "TermEnter" },
|
||||
{
|
||||
group = terminalgroup,
|
||||
pattern = "*",
|
||||
command = "set nonumber"
|
||||
}
|
||||
)
|
||||
local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true })
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ "TermOpen", "TermEnter" },
|
||||
{
|
||||
group = terminalgroup,
|
||||
pattern = "*",
|
||||
command = "set nonumber"
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
-- lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
2
nvim/lua/plugins.lua
Normal file
2
nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
return {
|
||||
}
|
Loading…
Add table
Reference in a new issue