Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
require ('packer-plugins')
require ('globals')
require ('general-options')
require ('keyboard-shortcuts')
require('globals')
require('general-options')
require('keyboard-shortcuts')
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

-- Example using a list of specs with the default options
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct
vim.g.maplocalleader = "\\" -- Same for `maplocalleader`

require("lazy").setup("plugins")
39 changes: 39 additions & 0 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"LazyVim": { "branch": "main", "commit": "4b1d39762773f60f35e73c32596610e360113a6a" },
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"friendly-snippets": { "branch": "main", "commit": "700c4a25caacbb4648c9a27972c2fe203948e0c2" },
"git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
"gruvbox.nvim": { "branch": "main", "commit": "d4cde3853a172485961b515c36d51d757728d6e6" },
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "8db12610bcb7ce67013cfdfaba4dd47a23c6e851" },
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
"mini.ai": { "branch": "main", "commit": "a7e90f110e6274262616311b93cef12cd2667a2d" },
"mini.pairs": { "branch": "main", "commit": "40261dfcec7623cd57be3c3beb50fa73f2650cdf" },
"nerdtree": { "branch": "master", "commit": "fbb71fcd90602e3ec77f40b864b5f9b437c496c5" },
"nerdtree-git-plugin": { "branch": "master", "commit": "e1fe727127a813095854a5b063c15e955a77eafb" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" },
"nvim-send-to-term": { "branch": "master", "commit": "e0aa448d417a553d19cba8c78d91993387f1ff2d" },
"nvim-snippets": { "branch": "main", "commit": "5c978b3ba0c504dc9f94ca93d17029f26064d229" },
"nvim-treesitter": { "branch": "master", "commit": "b47dde81a0a4b9b62e9a73a71ff0df2202323dd9" },
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
"oil.nvim": { "branch": "master", "commit": "18272aba9d00a3176a5443d50dbb4464acc167bd" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
"vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" },
"vim-grepper": { "branch": "master", "commit": "485d349125d46f2788833ecb43df7a14c46706f6" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" },
"vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" },
"zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
}
9 changes: 9 additions & 0 deletions nvim/lazyvim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extras": [

],
"news": {
"NEWS.md": "6077"
},
"version": 6
}
71 changes: 37 additions & 34 deletions nvim/lua/general-options.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
vim.g.mapleader = " "
vim.keymap.set('i', 'jk', '<ESC>')

local opt = vim.opt

-- number settings
vim.o.number = true
vim.o.relativenumber = true
vim.o.numberwidth = 3
opt.number = true
opt.relativenumber = true
opt.numberwidth = 3
vim.cmd [[
:augroup numbertoggle
: autocmd!
Expand All @@ -13,38 +15,39 @@ vim.cmd [[
:augroup END
]]

vim.o.mouse = 'a'
vim.o.background = "dark"
vim.o.colorcolumn = "80"
vim.o.cursorcolumn = true
vim.o.gfn = "Fira Code:h14"
vim.o.cursorline = true
vim.o.directory = "$HOME/vimfiles/swp/"
vim.o.hidden = true
vim.o.ignorecase = true
opt.mouse = 'a'
opt.background = "dark"
opt.colorcolumn = "80"
opt.cursorcolumn = true
opt.gfn = "Fira Code:14"
-- opt.gfn = "FiraCode Nerd Font:h14"
opt.cursorline = true
opt.directory = "$HOME/vimfiles/swp/"
opt.hidden = true
opt.ignorecase = true
-- show in split window when replacing
vim.o.inccommand = "split"
vim.o.updatetime = 100
opt.inccommand = "split"
opt.updatetime = 100

-- show list chars
vim.opt.list = true
vim.opt.listchars = { eol = '¶', tab = '>-', trail = '~', extends = '>', precedes = '<' }

vim.o.backup = false
vim.o.swapfile = false
vim.o.scrolloff = 3
vim.o.shiftround = true
vim.o.shiftwidth = 2
vim.o.showmatch = true
vim.o.showtabline = 1
vim.o.sidescrolloff = 5
vim.o.smartcase = true -- case instance search
vim.o.smartindent = true
vim.o.splitbelow = true
vim.o.splitright = true
vim.o.undofile = true
vim.o.undodir = vim.fn.expand('~/vimfiles/undodir')
vim.o.wildmenu = true
opt.backup = false
opt.swapfile = false
opt.scrolloff = 3
opt.shiftround = true
opt.shiftwidth = 2
opt.showmatch = true
opt.showtabline = 1
opt.sidescrolloff = 5
opt.smartcase = true -- case instance search
opt.smartindent = true
opt.splitbelow = true
opt.splitright = true
opt.undofile = true
opt.undodir = vim.fn.expand('~/vimfiles/undodir')
opt.wildmenu = true
vim.cmd [[
augroup vimrc-incsearch-highlight
autocmd!
Expand All @@ -65,16 +68,16 @@ autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank({
higroup = 'IncSearch',
timeout = 400,
timeout = 450,
})
end,
})


vim.o.incsearch = true
-- vim.o.hlsearch = true
vim.o.tabstop = 2
vim.o.softtabstop = 2
opt.incsearch = true
-- opt.hlsearch = true
opt.tabstop = 2
opt.softtabstop = 2

vim.cmd [[
filetype plugin on
Expand Down
11 changes: 1 addition & 10 deletions nvim/lua/keyboard-shortcuts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,4 @@ vim.keymap.set('t', '<C-L>', '<C-\\><C-n><C-W><C-L>')
-- vim.keymap.set('n', '<leader><CR>', ':so $MYVIMRC<CR>')
nmap('<leader><CR>', ':so %<CR>')
nmap('<leader>w', ':up<CR>')
nmap('<leader><space>', ':FZF<CR>')
nmap('<leader>b', ':Buffers<CR>')


local stackmap = require("stackmap")
stackmap.push("lua_test", "n", {
["<space>t"] = "<Plug>PlenaryTestFile"
})

-- stackmap.pop("lua_test")
nmap('<leader>b', ':Buffers<CR>')
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
if has('Win64')
return {
'christoomey/vim-system-copy',
config = function()
vim.cmd(
[[
if has('Win64')
let g:system_copy#copy_command='clip'
let g:system_copy#paste_command='powershell.exe -NoLogo -NoProfile -Noninteractive -Command "Get-Clipboard"'
endif
]]
)
end
}
12 changes: 12 additions & 0 deletions nvim/lua/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },

-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
}
}
14 changes: 14 additions & 0 deletions nvim/lua/plugins/fugitive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
'tpope/vim-fugitive',
config = function ()
vim.keymap.set('n', '<leader>gs', ':Git<CR>')
vim.keymap.set('n', '<leader>gps', ':Git push<CR>')
vim.keymap.set('n', '<leader>gpl', ':Git pull<CR>')
vim.keymap.set('n', '<leader>gpf', ':Git fetch<CR>')
vim.keymap.set('n', '<leader>gbl', ':Git blame<CR>')
-- vim.keymap.set('n', '<leader>gpr', ':Git rebase<CR>')
-- vim.keymap.set('n', 'gdu', '<cmd>diffget //2<CR>')
-- vim.keymap.set('n', 'gdi', '<cmd>diffget //3<CR>')
end,

}
12 changes: 12 additions & 0 deletions nvim/lua/plugins/git-worktree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
"ThePrimeagen/git-worktree.nvim",
dependencies = {
'nvim-telescope/telescope.nvim',
},
config = function()
require("git-worktree").setup({})
require("telescope").load_extension("git_worktree")
vim.keymap.set('n', '<leader>gws', ':Telescope git_worktree git_worktrees<CR>')
vim.keymap.set('n', '<leader>gwc', ':Telescope git_worktree create_git_worktree<CR>')
end
}
40 changes: 40 additions & 0 deletions nvim/lua/plugins/harpoon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {
'ThePrimeagen/harpoon',
branch = "harpoon2",
dependencies = { { 'nvim-lua/plenary.nvim' } },
config = function()
local harpoon = require('harpoon')

harpoon:setup({})

-- basic telescope configuration
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end

require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end

vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon window" })
-- -- These functions are stored in harpoon. A plugn that I am developing
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
-- vim.keymap.set('n', "<C-e>", function() require("harpoon.ui").toggle_quick_menu() end, silent)
vim.keymap.set("n", "<leader>hm", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
--
vim.keymap.set('n', "<leader>f1", function() harpoon:list():select(1) end)
vim.keymap.set('n', "<leader>f2", function() harpoon:list():select(2) end)
vim.keymap.set('n', "<leader>f3", function() harpoon:list():select(3) end)
vim.keymap.set('n', "<leader>f4", function() harpoon:list():select(4) end)
end
}
7 changes: 7 additions & 0 deletions nvim/lua/plugins/lua-line.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'kyazdani42/nvim-web-devicons', opt = true },
config = function()
require("lualine").setup()
end
}
11 changes: 11 additions & 0 deletions nvim/lua/plugins/mason.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return {
{
'williamboman/mason.nvim',
dependencies = 'williamboman/mason-lspconfig.nvim',
config = function()
require('mason-lspconfig').setup {
ensure_installed = { "lua-ls", "tsserver" }
}
end
}
}
31 changes: 31 additions & 0 deletions nvim/lua/plugins/mini-ai.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
return {
"echasnovski/mini.ai",
event = "VeryLazy",
opts = function()
LazyVim.on_load("which-key.nvim", function()
vim.schedule(LazyVim.mini.ai_whichkey)
end)
local ai = require("mini.ai")
return {
n_lines = 500,
custom_textobjects = {
o = ai.gen_spec.treesitter({ -- code block
a = { "@block.outer", "@conditional.outer", "@loop.outer" },
i = { "@block.inner", "@conditional.inner", "@loop.inner" },
}),
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
d = { "%f[%d]%d+" }, -- digits
e = { -- Word with case
{ "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
"^().*()$",
},
i = LazyVim.mini.ai_indent, -- indent
g = LazyVim.mini.ai_buffer, -- buffer
u = ai.gen_spec.function_call(), -- u for "Usage"
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
},
}
end,
}
23 changes: 23 additions & 0 deletions nvim/lua/plugins/mini-pairs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
return {
"echasnovski/mini.pairs",
event = "VeryLazy",
opts = {
mappings = {
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } },
},
},
keys = {
{
"<leader>up",
function()
vim.g.minipairs_disable = not vim.g.minipairs_disable
if vim.g.minipairs_disable then
LazyVim.warn("Disabled auto pairs", { title = "Option" })
else
LazyVim.info("Enabled auto pairs", { title = "Option" })
end
end,
desc = "Toggle Auto Pairs",
},
},
}
16 changes: 16 additions & 0 deletions nvim/lua/plugins/nerd-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
return {
"scrooloose/nerdtree",
lazy = false,
dependencies = {
{ 'ryanoasis/vim-devicons' },
{ 'Xuyuanp/nerdtree-git-plugin' }
},
config = function()
vim.keymap.set('n', '<C-n>', ":NERDTreeToggle<CR>")
vim.keymap.set('n', '<Leader>zf', ":NERDTreeFind<CR>")

vim.cmd [[
let g:NERDTreeWinPos = "right"
]]
end,
}
Loading