Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #1

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8eeaaff
Initial commit
Sep 27, 2021
e853d10
config updates
Oct 29, 2021
160f28f
updates...
rahsheen Dec 12, 2021
abaa616
update zshrc
rahsheen Dec 13, 2021
3cf45f0
fix RVM bug
rahsheen Jan 15, 2022
0f28b0c
update PATH and vim tweaks
rahsheen Jan 16, 2022
5af414e
add some scripts
rahsheen Jan 17, 2022
7ec203a
add Rg search binding
rahsheen Jan 17, 2022
28cf00c
update tmux stuff
rahsheen Jan 18, 2022
2be5d32
delete stuff
rahsheen Jan 18, 2022
85d2bb3
update init.vim
rahsheen Jan 18, 2022
4e693b7
move nvm to antigen lazy load
rahsheen Jan 21, 2022
c55035e
add fzf checkout
rahsheen Jan 24, 2022
0bc180e
add rhubarb and such
rahsheen May 11, 2022
cb1129c
Merge branch 'main' of github.com:rahsheen/dotfiles into main
rahsheen May 11, 2022
056e97c
Merged master
rahsheen May 11, 2022
bf8cc60
tmux theme and nvim fixes and ide command
rahsheen May 27, 2022
d1632ca
config tweaks
rahsheen Jul 7, 2022
95b21f7
sessionizer and init.vim
rahsheen Oct 28, 2022
4ca7354
tool-versions
rahsheen Oct 28, 2022
bcb0717
git config
rahsheen Oct 28, 2022
9edb53b
add github copilot plugin
rahsheen Nov 6, 2021
b9ca1cc
zshrc cleanup
rahsheen Oct 28, 2022
fc16a54
update sessionizer paths
rahsheen Nov 6, 2022
b63772b
move to nvim lua and lsp
rahsheen Nov 7, 2022
0f401d2
Merge pull request #1 from rahsheen/feat/convert-nvim-to-lua
rahsheen Nov 7, 2022
b1a7860
added keybindings
rahsheen Nov 7, 2022
38bb894
remove broke bindings
rahsheen Nov 10, 2022
2184d0d
add alias to vim homedir and git remaps
rahsheen Nov 12, 2022
98ae2fe
more updates
rahsheen Nov 17, 2022
5b79ed6
durka dur
rahsheen Nov 17, 2022
b32fa96
fzf and aliases
rahsheen Nov 23, 2022
1f2f336
revamped nvim config with lsp.zero
rahsheen Jan 1, 2023
f3d84f9
fix rails setup
rahsheen Jan 2, 2023
897d00a
complete refactor with kickstart.nvim
rahsheen Feb 4, 2023
912b5c0
kickstart
rahsheen Apr 30, 2023
750e9fd
finally got ripgrep search plus codeactions in telescope
rahsheen May 8, 2023
7bc48c6
update zsh history config
rahsheen Aug 6, 2023
7d66dea
minor updates and such
rahsheen Aug 29, 2023
d7a68e4
add git blame keybind
rahsheen Oct 7, 2023
fb50b61
disable null_ls debig
rahsheen Oct 7, 2023
6a2fa6f
add trouble keybindings
rahsheen Oct 7, 2023
8faf8d8
fix sessionizer
rahsheen Oct 7, 2023
0e2a749
fall back to another session when closing session
rahsheen Oct 7, 2023
7e4a712
add live grep args
rahsheen Oct 7, 2023
2cb34c3
merge kickstart
rahsheen Oct 7, 2023
9151224
bruh...
rahsheen Feb 25, 2024
01098b6
remove nvim config
rahsheen Feb 26, 2024
8163cad
Merge commit 'dddf11332f4d03144431d98805f28cbc91dfdaa0' as '.config/n…
rahsheen Feb 26, 2024
2ed61e5
add subtree for kickstart.nvim
rahsheen Feb 26, 2024
06382cf
start adding debugging
rahsheen Feb 28, 2024
e272951
update nvim config and junk
rahsheen Mar 1, 2024
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
2 changes: 2 additions & 0 deletions after/plugin/defaults.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require("rahcodes.remap")
require("rahcodes.sets")
21 changes: 21 additions & 0 deletions after/plugin/fugitive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
vim.keymap.set("n", "<leader>gs", ":G<CR>")
vim.keymap.set("n", "<leader>gh", ":diffget //3<CR>")
vim.keymap.set("n", "<leader>gu", ":diffget //2<CR>")
vim.keymap.set("n", "<leader>gc", ":GCheckout<CR>")
vim.keymap.set("n", "<leader>ga", ":G add %:p<CR><CR>")
vim.keymap.set("n", "<leader>gc", ":G commit -v -q<CR>")
vim.keymap.set("n", "<leader>gt", ":G commit -v -q %:p<CR>")
vim.keymap.set("n", "<leader>gff", ":G ff<CR>")
vim.keymap.set("n", "<leader>gfo", ":G fetch origin<CR>")
vim.keymap.set("n", "<leader>gd", ":Gdiff<CR>")
vim.keymap.set("n", "<leader>ge", ":Gedit<CR>")
vim.keymap.set("n", "<leader>gr", ":Gread<CR>")
vim.keymap.set("n", "<leader>grb", ":G rebase -i<CR>")
vim.keymap.set("n", "<leader>gw", ":Gwrite<CR><CR>")
vim.keymap.set("n", "<leader>gl", ":silent! Glog<CR>:bot copen<CR>")
vim.keymap.set("n", "<leader>gp", ":Ggrep<Space>")
vim.keymap.set("n", "<leader>gm", ":Gmove<Space>")
vim.keymap.set("n", "<leader>gbl", ":G blame<CR>")
vim.keymap.set("n", "<leader>go", ":G checkout<Space>")
vim.keymap.set("n", "<leader>gps", ":Dispatch! git push<CR>")
vim.keymap.set("n", "<leader>gpl", ":Dispatch! git pull<CR>")
22 changes: 22 additions & 0 deletions after/plugin/git-worktree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local Worktree = require("git-worktree")

-- op = Operations.Switch, Operations.Create, Operations.Delete
-- metadata = table of useful values (structure dependent on op)
-- Switch
-- path = path you switched to
-- prev_path = previous worktree path
-- Create
-- path = path where worktree created
-- branch = branch name
-- upstream = upstream remote name
-- Delete
-- path = path where worktree deleted

Worktree.on_tree_change(function(op, metadata)
if op == Worktree.Operations.Switch then
print("Switched from " .. metadata.prev_path .. " to " .. metadata.path)
end
end)

vim.keymap.set("n", "<leader>bw", require("telescope").extensions.git_worktree.git_worktrees, { desc = "[B]rowse Git Worktrees" })
vim.keymap.set("n", "<leader>cw", require("telescope").extensions.git_worktree.create_git_worktree, { desc = "[C]reate Git [W]orktree" })
13 changes: 13 additions & 0 deletions after/plugin/lualine.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require("lualine").setup({
options = {
theme = "tokyonight",
tabline = {
lualine_a = { "buffers" },
lualine_b = { "branch" },
lualine_c = { "filename" },
lualine_x = {},
lualine_y = {},
lualine_z = { "tabs" },
},
},
})
75 changes: 75 additions & 0 deletions after/plugin/null-ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
local setup, null_ls = pcall(require, "null-ls")
if not setup then
return
end

local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics
local conditional = function(fn)
local utils = require("null-ls.utils").make_conditional_utils()
return fn(utils)
end

local lsp_formatting = function(bufnr)
vim.lsp.buf.format({
timeout_ms = 2000,
filter = function(client)
-- apply whatever logic you want (in this example, we'll only use null-ls)
return client.name ~= "tsserver"
end,
bufnr = bufnr,
})
end

local augroup = vim.api.nvim_create_augroup("LspFormatting", {})

-- local my_rubocop_formatter = require("rahcodes.null-ls.rubocop")
local rubocop = null_ls.builtins.formatting.rubocop

null_ls.setup({
debug = false,
sources = {
formatting.prettier,
-- formatting.stylua,
null_ls.builtins.code_actions.gitsigns,
-- setting eslint_d only if we have a ".eslintrc.js" file in the project
diagnostics.eslint_d.with({
condition = function(utils)
return utils.root_has_file({ '.eslintrc.js' })
end
}),

-- Here we set a conditional to call the rubocop formatter. If we have a Gemfile in the project, we call "bundle exec rubocop", if not we only call "rubocop".
conditional(function(utils)
return utils.root_has_file("Gemfile")
and rubocop.with({
command = "bundle",
args = vim.list_extend({ "exec", "rubocop" }, rubocop._opts.args),
})
or rubocop
end),

-- Same as above, but with diagnostics.rubocop to make sure we use the proper rubocop version for the project
conditional(function(utils)
return utils.root_has_file("Gemfile")
and null_ls.builtins.diagnostics.rubocop.with({
command = "bundle",
args = vim.list_extend({ "exec", "rubocop" }, null_ls.builtins.diagnostics.rubocop._opts.args),
})
or null_ls.builtins.diagnostics.rubocop
end),
},
-- format on save
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
lsp_formatting(bufnr)
end,
})
end
end,
})
2 changes: 2 additions & 0 deletions after/plugin/telescope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pcall(require("telescope").load_extension, "ui-select")
pcall(require("telescope").load_extension, "live_grep_args")
24 changes: 12 additions & 12 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ require('lazy').setup({
},
},

{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
opts = {},
},
-- {
-- -- Add indentation guides even on blank lines
-- 'lukas-reineke/indent-blankline.nvim',
-- -- Enable `lukas-reineke/indent-blankline.nvim`
-- -- See `:help ibl`
-- main = 'ibl',
-- opts = {},
-- },

-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
Expand Down Expand Up @@ -274,15 +274,15 @@ require('lazy').setup({
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',
require 'kickstart.plugins.debug',

-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
-- up-to-date with whatever is in the kickstart repo.
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
}, {})

-- [[ Setting options ]]
Expand Down Expand Up @@ -424,7 +424,7 @@ local function telescope_live_grep_open_files()
end
vim.keymap.set('n', '<leader>s/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' })
vim.keymap.set('n', '<leader>ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]les' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
Expand Down Expand Up @@ -590,7 +590,7 @@ local servers = {
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
-- tsserver = {},
tsserver = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} },

lua_ls = {
Expand Down
39 changes: 39 additions & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "cdbf6f41381e5ee4810b4b09284b603d8f18365d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"fidget.nvim": { "branch": "main", "commit": "60404ba67044c6ab01894dd5bf77bd64ea5e09aa" },
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
"git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "3614a39aae98ccd34124b072939d6283853b3dd2" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"neodev.nvim": { "branch": "main", "commit": "3157f2e876fd6223d36cfa76bee4709247d62fa5" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" },
"nvim-dap-go": { "branch": "main", "commit": "64f73400761e2d19459e664a52ea478f3a4420e7" },
"nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" },
"nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" },
"nvim-lspconfig": { "branch": "master", "commit": "b1a11b042d015df5b8f7f33aa026e501b639c649" },
"nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" },
"nvim-treesitter": { "branch": "master", "commit": "db12bd416e2764420047e4a5d6b96fe44e4377d5" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"refactoring.nvim": { "branch": "master", "commit": "94444558fc651b7e36f39d86c518e44b4de15123" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "20656efd7a0dbb4483290649c9671af14b0cfb0d" },
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"vim-fugitive": { "branch": "master", "commit": "2e88f14a585c014691904ba8fe39e6ea851c9422" },
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}
73 changes: 68 additions & 5 deletions lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
{
"ThePrimeagen/refactoring.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
config = function()
require("refactoring").setup({})
end,
},
{
"ThePrimeagen/git-worktree.nvim",
},
{
"folke/tokyonight.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- load the colorscheme here
vim.cmd([[colorscheme tokyonight]])
end,
},
-- formatting & linting
"jose-elias-alvarez/null-ls.nvim",
-- use("jayp0521/mason-null-ls.nvim")
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end,
},
{
"folke/trouble.nvim",
requires = "nvim-tree/nvim-web-devicons",
config = function()
require("trouble").setup({
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
})
end,
},
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
{
"nvim-telescope/telescope-live-grep-args.nvim",
-- This will not install any breaking changes.
-- For major updates, this must be adjusted manually.
version = "^1.0.0",
},
},
config = function()
require("telescope").load_extension("live_grep_args")
end
}
}
42 changes: 42 additions & 0 deletions lua/kickstart/plugins/debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ return {

-- Add your own debuggers here
'leoluz/nvim-dap-go',
'mxsdev/nvim-dap-vscode-js'
},
config = function()
local dap = require 'dap'
Expand All @@ -39,6 +40,8 @@ return {
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
'typescript',
'typescriptreact',
},
}

Expand Down Expand Up @@ -83,5 +86,44 @@ return {

-- Install golang specific config
require('dap-go').setup()

require("dap-vscode-js").setup({
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
debugger_path = vim.fn.stdpath('data') .. "/lazy/vscode-js-debug", -- Path to vscode-js-debug installation.
-- debugger_cmd = { "extension" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
adapters = { 'chrome', 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost', 'node', 'chrome' }, -- which adapters to register in nvim-dap
-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
})

local js_based_languages = { "typescript", "javascript", "typescriptreact" }

for _, language in ipairs(js_based_languages) do
require("dap").configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require 'dap.utils'.pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with \"localhost\"",
url = "http://localhost:3000",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
}
}
end
end,
}
20 changes: 20 additions & 0 deletions lua/rahcodes/keymap.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local M = {}

local function bind(op, outer_opts)
outer_opts = outer_opts or {noremap = true}
return function(lhs, rhs, opts)
opts = vim.tbl_extend("force",
outer_opts,
opts or {}
)
vim.keymap.set(op, lhs,rhs, opts)
end
end

M.nmap = bind("n", {noremap = false})
M.nnoremap = bind("n")
M.vnoremap = bind("v")
M.xnoremap = bind("x")
M.inoremap = bind("i")

return M
Loading