Compare commits
9 Commits
d2bc567a8c
...
782f37021e
Author | SHA1 | Date | |
---|---|---|---|
782f37021e | |||
12aa936655 | |||
330c26bddb | |||
a1f0559227 | |||
1929ec4eff | |||
8c7fb8053b | |||
49ac91e246 | |||
95c89e1fa0 | |||
7b3e08f8a9 |
@ -1 +1,3 @@
|
|||||||
|
require("nat.set")
|
||||||
|
require("nat.remap")
|
||||||
require("nat.lazy_init")
|
require("nat.lazy_init")
|
||||||
|
@ -1,4 +1,43 @@
|
|||||||
return {
|
return { "numToStr/Comment.nvim", opts = function() require("Comment").setup({
|
||||||
"numToStr/Comment.nvim",
|
-- Add a space b/w comment and the line
|
||||||
opts = function() require("Comment").setup({ }) end
|
padding = true,
|
||||||
}
|
-- Whether the cursor should stay at its position
|
||||||
|
sticky = true,
|
||||||
|
-- Lines to be ignored while (un)comment
|
||||||
|
ignore = nil,
|
||||||
|
-- LHS of toggle mappings in NORMAL mode
|
||||||
|
toggler = {
|
||||||
|
-- Line-comment toggle keymap
|
||||||
|
line = 'gcc',
|
||||||
|
-- Block-comment toggle keymap
|
||||||
|
block = 'gbc',
|
||||||
|
},
|
||||||
|
-- LHS of operator-pending mappings in NORMAL and VISUAL mode
|
||||||
|
opleader = {
|
||||||
|
-- Line-comment keymap
|
||||||
|
line = 'gc',
|
||||||
|
-- Block-comment keymap
|
||||||
|
block = 'gb',
|
||||||
|
},
|
||||||
|
-- LHS of extra mappings
|
||||||
|
extra = {
|
||||||
|
-- Add comment on the line above
|
||||||
|
above = 'gcO',
|
||||||
|
-- Add comment on the line below
|
||||||
|
below = 'gco',
|
||||||
|
-- Add comment at the end of line
|
||||||
|
eol = 'gcA',
|
||||||
|
},
|
||||||
|
-- Enable keybindings
|
||||||
|
-- NOTE: If given `false` then the plugin won't create any mappings
|
||||||
|
mappings = {
|
||||||
|
-- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
|
||||||
|
basic = true,
|
||||||
|
-- Extra mapping; `gco`, `gcO`, `gcA`
|
||||||
|
extra = true,
|
||||||
|
},
|
||||||
|
-- Function to call before (un)comment
|
||||||
|
pre_hook = nil,
|
||||||
|
-- Function to call after (un)comment
|
||||||
|
post_hook = nil,
|
||||||
|
}) end }
|
||||||
|
34
lua/nat/lazy/fugitive.lua
Normal file
34
lua/nat/lazy/fugitive.lua
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
return {
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||||
|
|
||||||
|
local nat_Fugitive = vim.api.nvim_create_augroup("nat_Fugitive", {})
|
||||||
|
|
||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
autocmd("BufWinEnter", {
|
||||||
|
group = nat_Fugitive,
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
if vim.bo.ft ~= "fugitive" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
local opts = {buffer = bufnr, remap = false}
|
||||||
|
-- rebase always
|
||||||
|
vim.keymap.set("n", "<leader>gp", function() vim.cmd.Git({'pull', '--rebase'}) end, opts)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>gP", function() vim.cmd.Git('push') end, opts)
|
||||||
|
|
||||||
|
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
|
||||||
|
-- needed if i did not set the branch up correctly
|
||||||
|
vim.keymap.set("n", "<leader>gT", ":Git push -u origin ", opts);
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
vim.keymap.set("n", "gu", "<cmd>diffget //2<CR>")
|
||||||
|
vim.keymap.set("n", "gh", "<cmd>diffget //3<CR>")
|
||||||
|
end
|
||||||
|
}
|
21
lua/nat/lazy/neotest.lua
Normal file
21
lua/nat/lazy/neotest.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
return { { "nvim-neotest/neotest", dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"marilari88/neotest-vitest",
|
||||||
|
"nvim-neotest/neotest-plenary",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local neotest = require("neotest")
|
||||||
|
neotest.setup({
|
||||||
|
adapters = {
|
||||||
|
require("neotest-vitest"),
|
||||||
|
-- require("neotest-plenary").setup({
|
||||||
|
-- -- this is my standard location for minimal vim rc
|
||||||
|
-- -- in all my projects
|
||||||
|
-- min_init = "./scripts/tests/minimal.vim",
|
||||||
|
-- }),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.keymap.set("n", "<leader>tc", function() neotest.run.run() end)
|
||||||
|
end } }
|
1
lua/nat/lazy/nio.lua
Normal file
1
lua/nat/lazy/nio.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { { "nvim-neotest/nvim-nio" } }
|
@ -1,48 +1,41 @@
|
|||||||
return {
|
return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function()
|
||||||
"nvim-treesitter/nvim-treesitter",
|
require("nvim-treesitter.configs").setup({
|
||||||
build = ":TSUpdate",
|
-- A list of parser names, or "all"
|
||||||
config = function()
|
ensure_installed = {
|
||||||
require("nvim-treesitter.configs").setup({
|
"vimdoc", "javascript", "typescript", "vue", "lua", "yaml",
|
||||||
-- A list of parser names, or "all"
|
"jsdoc", "bash", "powershell", "c_sharp", "json", "sql",
|
||||||
ensure_installed = {
|
"vim", "html", "css", "scss", "jsonc", "python", "http",
|
||||||
"vimdoc", "javascript", "typescript", "vue", "lua", "yaml",
|
"xml", "cpp", "rust", "go", "php", "ruby",
|
||||||
"jsdoc", "bash", "powershell", "c_sharp", "json", "sql",
|
},
|
||||||
"vim", "html", "css", "scss", "jsonc", "python", "http",
|
|
||||||
"xml"
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
-- Automatically install missing parsers when entering buffer
|
||||||
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
|
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
|
||||||
indent = {
|
indent = {
|
||||||
enable = true
|
enable = true
|
||||||
},
|
},
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
-- `false` will disable the whole extension
|
-- `false` will disable the whole extension
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
||||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
-- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
|
-- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
|
||||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
-- Instead of true it can also be a list of languages
|
-- Instead of true it can also be a list of languages
|
||||||
additional_vim_regex_highlighting = { "markdown" },
|
additional_vim_regex_highlighting = { "markdown" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
treesitter_parser_config.templ = {
|
treesitter_parser_config.templ = { install_info = {
|
||||||
install_info = {
|
url = "https://github.com/vrischmann/tree-sitter-templ.git",
|
||||||
url = "https://github.com/vrischmann/tree-sitter-templ.git",
|
files = {"src/parser.c", "src/scanner.c"}, branch = "master",
|
||||||
files = {"src/parser.c", "src/scanner.c"},
|
} }
|
||||||
branch = "master",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.treesitter.language.register("templ", "templ")
|
vim.treesitter.language.register("templ", "templ")
|
||||||
end
|
end }
|
||||||
}
|
|
||||||
|
23
lua/nat/lazy/trouble.lua
Normal file
23
lua/nat/lazy/trouble.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
config = function()
|
||||||
|
require("trouble").setup({
|
||||||
|
icons = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>tt", function()
|
||||||
|
require("trouble").toggle()
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "[t", function()
|
||||||
|
require("trouble").next({skip_groups = true, jump = true});
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "]t", function()
|
||||||
|
require("trouble").previous({skip_groups = true, jump = true});
|
||||||
|
end)
|
||||||
|
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
@ -1,11 +1,8 @@
|
|||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local out = vim.fn.system({
|
local out = vim.fn.system({ "git", "clone",
|
||||||
"git",
|
"--filter=blob:none", "--branch=stable",
|
||||||
"clone",
|
|
||||||
"--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable",
|
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
@ -20,12 +17,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
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
|
-- Setup lazy.nvim
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = "nat.lazy",
|
spec = "nat.lazy",
|
||||||
|
19
lua/nat/remap.lua
Normal file
19
lua/nat/remap.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = "<5C>"
|
||||||
|
|
||||||
|
-- https://neovim.reddit.com/comments/xykklt/_/j4gxyqx
|
||||||
|
vim.keymap.set("n", "<C-_>", function()
|
||||||
|
require("Comment.api").toggle.linewise.current() end,
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>Tt", function() vim.cmd [[Neotree toggle left]] end)
|
||||||
|
vim.keymap.set("n", "<leader>Tf", function() vim.cmd [[Neotree toggle float]] end)
|
||||||
|
|
||||||
|
-- Map Alt + Up to move the current line up
|
||||||
|
vim.keymap.set("n", "<A-Up>", ":m .-2<CR>==", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set("i", "<A-Up>", "<Esc>:m .-2<CR>==gi", { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- -- Map Alt + Down to move the current line down
|
||||||
|
vim.keymap.set("n", "<A-Down>", ":m .+1<CR>==", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set("i", "<A-Down>", "<Esc>:m .+1<CR>==gi", { noremap = true, silent = true })
|
@ -1,45 +1,35 @@
|
|||||||
vim.g.mapleader = " "
|
-- local HOME = "C:\\Users\\Nathan"
|
||||||
|
local HOME = os.getenv("HOME") or "~"
|
||||||
|
|
||||||
local set = vim.opt
|
vim.opt.guicursor = ""
|
||||||
local HOME = "C:\\Users\\Nathan"
|
vim.opt.nu = true
|
||||||
|
|
||||||
set.guicursor = ""
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
-- set.number = "relativenumber"
|
vim.opt.paste = true
|
||||||
set.relativenumber = true
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.softtabstop = 2
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
|
||||||
set.tabstop = 2
|
vim.opt.smartindent = true
|
||||||
set.softtabstop = 2
|
|
||||||
set.shiftwidth = 2
|
|
||||||
set.expandtab = true
|
|
||||||
|
|
||||||
set.smartindent = true
|
vim.opt.wrap = false
|
||||||
|
|
||||||
set.wrap = false
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.backup = false
|
||||||
|
vim.opt.undodir = HOME .. "/.vim/undodir"
|
||||||
|
vim.opt.undofile = true
|
||||||
|
|
||||||
set.swapfile = false
|
vim.opt.hlsearch = false
|
||||||
set.backup = false
|
vim.opt.incsearch = true
|
||||||
set.undodir = HOME .. "/.vim/undodir"
|
|
||||||
set.undofile = true
|
|
||||||
|
|
||||||
set.hlsearch = false
|
vim.opt.termguicolors = true
|
||||||
set.incsearch = true
|
|
||||||
|
|
||||||
set.termguicolors = true
|
vim.opt.scrolloff = 8
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
vim.opt.isfname:append("@-@")
|
||||||
|
|
||||||
set.scrolloff = 8
|
vim.opt.updatetime = 50
|
||||||
set.signcolumn = "yes"
|
|
||||||
set.isfname:append("@-@")
|
|
||||||
|
|
||||||
set.updatetime = 50
|
-- vim.opt.colorcolumn = "161"
|
||||||
|
|
||||||
-- set.colorcolumn = "161"
|
|
||||||
|
|
||||||
-- https://neovim.reddit.com/comments/xykklt/_/j4gxyqx
|
|
||||||
vim.keymap.set("n", "<C-_>", function()
|
|
||||||
require('Comment.api').toggle.linewise.current() end,
|
|
||||||
{ noremap = true, silent = true }
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>tt", function() vim.cmd [[Neotree left toggle]] end)
|
|
||||||
vim.keymap.set("n", "<leader>tf", function() vim.cmd [[Neotree float]] end)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user