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")
|
||||
|
@ -1,4 +1,43 @@
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
opts = function() require("Comment").setup({ }) end
|
||||
}
|
||||
return { "numToStr/Comment.nvim", opts = function() require("Comment").setup({
|
||||
-- Add a space b/w comment and the line
|
||||
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,14 +1,11 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc", "javascript", "typescript", "vue", "lua", "yaml",
|
||||
"jsdoc", "bash", "powershell", "c_sharp", "json", "sql",
|
||||
"vim", "html", "css", "scss", "jsonc", "python", "http",
|
||||
"xml"
|
||||
"xml", "cpp", "rust", "go", "php", "ruby",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
@ -35,14 +32,10 @@ return {
|
||||
})
|
||||
|
||||
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
treesitter_parser_config.templ = {
|
||||
install_info = {
|
||||
treesitter_parser_config.templ = { install_info = {
|
||||
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")
|
||||
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"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local out = vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
local out = vim.fn.system({ "git", "clone",
|
||||
"--filter=blob:none", "--branch=stable",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
if vim.v.shell_error ~= 0 then
|
||||
@ -20,12 +17,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
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 = "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
|
||||
local HOME = "C:\\Users\\Nathan"
|
||||
vim.opt.guicursor = ""
|
||||
vim.opt.nu = true
|
||||
|
||||
set.guicursor = ""
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- set.number = "relativenumber"
|
||||
set.relativenumber = true
|
||||
vim.opt.paste = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.expandtab = false
|
||||
|
||||
set.tabstop = 2
|
||||
set.softtabstop = 2
|
||||
set.shiftwidth = 2
|
||||
set.expandtab = true
|
||||
vim.opt.smartindent = 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
|
||||
set.backup = false
|
||||
set.undodir = HOME .. "/.vim/undodir"
|
||||
set.undofile = true
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
set.hlsearch = false
|
||||
set.incsearch = true
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
set.termguicolors = true
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
set.scrolloff = 8
|
||||
set.signcolumn = "yes"
|
||||
set.isfname:append("@-@")
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
set.updatetime = 50
|
||||
|
||||
-- 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)
|
||||
-- vim.opt.colorcolumn = "161"
|
||||
|
Loading…
Reference in New Issue
Block a user