feat: add sessions
This commit is contained in:
parent
555edd89df
commit
2c30b093d5
@ -11,13 +11,13 @@ if u.has_plugin("packer") then
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
require "core.plugins"
|
|
||||||
require "impatient"
|
require "impatient"
|
||||||
|
require "core.plugins"
|
||||||
|
|
||||||
require "core.options"
|
require "core.options"
|
||||||
require "core.autocommands"
|
require "core.autocommands"
|
||||||
require "core.keymappings"
|
|
||||||
require "core.theme"
|
require "core.theme"
|
||||||
|
require "core.keymappings"
|
||||||
|
|
||||||
require "configs.dashboard"
|
require "configs.dashboard"
|
||||||
require "configs.command-center"
|
require "configs.command-center"
|
||||||
|
@ -2,6 +2,11 @@ local command_center = require("command_center")
|
|||||||
local noremap = { noremap = true }
|
local noremap = { noremap = true }
|
||||||
|
|
||||||
command_center.add({
|
command_center.add({
|
||||||
|
{
|
||||||
|
description = "Show Sessions",
|
||||||
|
cmd = ":lua require('session-lens').search_session()",
|
||||||
|
keybindings = { "n", "<leader><C-o>", noremap }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
description = "Search inside current buffer",
|
description = "Search inside current buffer",
|
||||||
cmd = "<CMD>Telescope current_buffer_fuzzy_find<CR>",
|
cmd = "<CMD>Telescope current_buffer_fuzzy_find<CR>",
|
||||||
@ -24,10 +29,12 @@ command_center.add({
|
|||||||
{
|
{
|
||||||
description = "Show function signaure (hover)",
|
description = "Show function signaure (hover)",
|
||||||
cmd = "<CMD>lua vim.lsp.buf.hover()<CR>",
|
cmd = "<CMD>lua vim.lsp.buf.hover()<CR>",
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
description = "(TS) Organize Imports",
|
description = "(TS) Organize Imports",
|
||||||
cmd = "<CMD>OrganizeImports<CR>"
|
cmd = "<CMD>OrganizeImports<CR>"
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
description = "ZenMode",
|
description = "ZenMode",
|
||||||
cmd = "<CMD>ZenMode<CR>",
|
cmd = "<CMD>ZenMode<CR>",
|
||||||
keybindings = { "n", "z", noremap }
|
keybindings = { "n", "z", noremap }
|
||||||
|
@ -32,15 +32,15 @@ local default = {
|
|||||||
preview_cutoff = 120
|
preview_cutoff = 120
|
||||||
},
|
},
|
||||||
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
||||||
file_ignore_patterns = {"node_modules"},
|
file_ignore_patterns = { "node_modules" },
|
||||||
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||||
path_display = {"truncate"},
|
path_display = { "truncate" },
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
border = {},
|
border = {},
|
||||||
borderchars = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"},
|
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||||
color_devicons = true,
|
color_devicons = true,
|
||||||
use_less = true,
|
use_less = true,
|
||||||
set_env = {["COLORTERM"] = "truecolor"}, -- default = nil,
|
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
||||||
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
||||||
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
||||||
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
|
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
|
||||||
@ -51,5 +51,7 @@ local default = {
|
|||||||
|
|
||||||
telescope.setup(default)
|
telescope.setup(default)
|
||||||
-- telescope.load_extension("themes");
|
-- telescope.load_extension("themes");
|
||||||
|
--
|
||||||
|
telescope.load_extension("session-lens")
|
||||||
telescope.load_extension("command_center");
|
telescope.load_extension("command_center");
|
||||||
telescope.load_extension("notify");
|
telescope.load_extension("notify");
|
||||||
|
@ -10,18 +10,11 @@ g.nvim_tree_show_icons = {
|
|||||||
git = 1
|
git = 1
|
||||||
}
|
}
|
||||||
require("nvim-tree").setup {
|
require("nvim-tree").setup {
|
||||||
auto_open = 1,
|
hijack_cursor = true,
|
||||||
gitignore = 1,
|
update_cwd = false,
|
||||||
group_empty = 1,
|
trash = {
|
||||||
hijack_cursor = 1,
|
cmd = "trash",
|
||||||
update_cwd = true,
|
require_confirm = true,
|
||||||
update_focused_file = {
|
|
||||||
enable = false
|
|
||||||
},
|
|
||||||
renderer = {
|
|
||||||
indent_markers = {
|
|
||||||
enable = 0
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@ -33,7 +26,6 @@ require("nvim-tree").setup {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
view = {
|
view = {
|
||||||
auto_resize = true,
|
|
||||||
hide_root_folder = true,
|
hide_root_folder = true,
|
||||||
signcolumn = "no"
|
signcolumn = "no"
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
local cmd = vim.cmd
|
local cmd = vim.cmd
|
||||||
|
|
||||||
cmd [[
|
local config_group = vim.api.nvim_create_augroup('Config', {})
|
||||||
augroup highlight_yank
|
vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
|
||||||
au!
|
group = config_group,
|
||||||
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 150 }
|
callback = function()
|
||||||
augroup END
|
vim.highlight.on_yank()
|
||||||
]]
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
cmd [[
|
cmd [[
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
local map = vim.api.nvim_set_keymap
|
local map = vim.api.nvim_set_keymap
|
||||||
local g = vim.g
|
local g = vim.g
|
||||||
|
|
||||||
local options = { noremap = true }
|
local options = { noremap = true, silent = true }
|
||||||
local remap = { noremap = false }
|
local remap = { noremap = false }
|
||||||
|
|
||||||
g.mapleader = " "
|
g.mapleader = " "
|
||||||
|
|
||||||
map("n", "<C-o>", ":Telescope find_files<CR>", options)
|
map("n", "<C-o>", ":Telescope git_files<CR>", options)
|
||||||
map("n", "<C-f>", ":Telescope live_grep<CR>", options)
|
map("n", "<C-f>", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }<CR>", options)
|
||||||
map("n", "<C-p>", ":Telescope command_center<CR>", options)
|
map("n", "<C-p>", ":Telescope command_center<CR>", options)
|
||||||
map("n", "<Shift>", "za", options)
|
map("n", "<Shift>", "za", options)
|
||||||
|
vim.notify("keys")
|
||||||
-- LSP Functionality
|
-- LSP Functionality
|
||||||
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", options)
|
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", options)
|
||||||
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", options)
|
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", options)
|
||||||
@ -36,7 +36,7 @@ map("n", "<A-Left>", ":bprevious<CR>", options);
|
|||||||
map("n", "<A-Right>", ":bnext<CR>", options);
|
map("n", "<A-Right>", ":bnext<CR>", options);
|
||||||
|
|
||||||
-- Backspace Delete like Browser
|
-- Backspace Delete like Browser
|
||||||
map('i', '<C-H>', '<Esc>caw', options)
|
map('i', '<C-H>', '<Esc>dbxi', options)
|
||||||
|
|
||||||
-- Copy visual selection to keyboard
|
-- Copy visual selection to keyboard
|
||||||
map("v", "Y", '"+y', options)
|
map("v", "Y", '"+y', options)
|
||||||
|
@ -12,7 +12,7 @@ set.clipboard = "unnamedplus" -- Copy paste between vim and everything else
|
|||||||
set.smarttab = true -- Makes tabbing smarter will realize you have 2 vs 4
|
set.smarttab = true -- Makes tabbing smarter will realize you have 2 vs 4
|
||||||
set.expandtab = true -- Converts tabs to spaces
|
set.expandtab = true -- Converts tabs to spaces
|
||||||
set.autoindent = true -- Good auto indent
|
set.autoindent = true -- Good auto indent
|
||||||
set.autochdir = true -- Your working directory will always be the same as your working directory
|
set.autochdir = false -- Your working directory will always be the same as your working directory
|
||||||
set.incsearch = true -- sets incremental search
|
set.incsearch = true -- sets incremental search
|
||||||
set.shell = "/bin/zsh" -- Set your shell to bash or zsh
|
set.shell = "/bin/zsh" -- Set your shell to bash or zsh
|
||||||
set.shortmess:append "sI" -- Disable nvim intro
|
set.shortmess:append "sI" -- Disable nvim intro
|
||||||
|
@ -8,10 +8,13 @@ return require("packer").startup(
|
|||||||
use "nvim-lua/plenary.nvim"
|
use "nvim-lua/plenary.nvim"
|
||||||
|
|
||||||
-- Theming Section
|
-- Theming Section
|
||||||
|
use "rktjmp/fwatch.nvim" -- Used to check dark/light theme
|
||||||
use "EdenEast/nightfox.nvim"
|
use "EdenEast/nightfox.nvim"
|
||||||
use "nvim-lualine/lualine.nvim"
|
use "nvim-lualine/lualine.nvim"
|
||||||
|
|
||||||
-- Layout Plugins
|
-- Layout Plugins
|
||||||
|
use "dstein64/nvim-scrollview" -- ScrollBars
|
||||||
|
use "akinsho/nvim-toggleterm.lua"
|
||||||
use { "folke/zen-mode.nvim", config = function() require("zen-mode").setup {} end }
|
use { "folke/zen-mode.nvim", config = function() require("zen-mode").setup {} end }
|
||||||
use "rcarriga/nvim-notify"
|
use "rcarriga/nvim-notify"
|
||||||
use "kyazdani42/nvim-web-devicons"
|
use "kyazdani42/nvim-web-devicons"
|
||||||
@ -43,7 +46,6 @@ return require("packer").startup(
|
|||||||
use "neovim/nvim-lspconfig"
|
use "neovim/nvim-lspconfig"
|
||||||
use "hrsh7th/nvim-cmp"
|
use "hrsh7th/nvim-cmp"
|
||||||
use "hrsh7th/cmp-nvim-lsp"
|
use "hrsh7th/cmp-nvim-lsp"
|
||||||
use "hrsh7th/cmp-nvim-lua"
|
|
||||||
use "hrsh7th/cmp-path"
|
use "hrsh7th/cmp-path"
|
||||||
use "hrsh7th/cmp-calc"
|
use "hrsh7th/cmp-calc"
|
||||||
use "hrsh7th/cmp-buffer"
|
use "hrsh7th/cmp-buffer"
|
||||||
@ -52,20 +54,18 @@ return require("packer").startup(
|
|||||||
use "L3MON4D3/LuaSnip"
|
use "L3MON4D3/LuaSnip"
|
||||||
use "saadparwaiz1/cmp_luasnip"
|
use "saadparwaiz1/cmp_luasnip"
|
||||||
use "williamboman/nvim-lsp-installer"
|
use "williamboman/nvim-lsp-installer"
|
||||||
use "brymer-meneses/grammar-guard.nvim"
|
|
||||||
use {
|
use {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
run = ":TSUpdate"
|
run = ":TSUpdate"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Autoformat
|
use {
|
||||||
use "lukas-reineke/lsp-format.nvim"
|
'rmagatti/session-lens',
|
||||||
|
requires = { 'rmagatti/auto-session', 'nvim-telescope/telescope.nvim' },
|
||||||
-- General Popup Window
|
config = function()
|
||||||
use "akinsho/nvim-toggleterm.lua"
|
require('session-lens').setup({ path_display = { 'shorten' } })
|
||||||
|
end
|
||||||
use "rktjmp/fwatch.nvim"
|
}
|
||||||
|
|
||||||
-- Database Feature
|
-- Database Feature
|
||||||
use "tpope/vim-dadbod"
|
use "tpope/vim-dadbod"
|
||||||
use "kristijanhusak/vim-dadbod-ui"
|
use "kristijanhusak/vim-dadbod-ui"
|
||||||
|
@ -1 +0,0 @@
|
|||||||
/home/max/.dotfiles/configs/lua
|
|
@ -1,7 +1,6 @@
|
|||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local u = require("utils")
|
|
||||||
local lazygit =
|
local lazygit =
|
||||||
Terminal:new(
|
Terminal:new(
|
||||||
{
|
{
|
||||||
cmd = "lazygit",
|
cmd = "lazygit",
|
||||||
dir = "git_dir",
|
dir = "git_dir",
|
||||||
@ -12,22 +11,22 @@ local lazygit =
|
|||||||
},
|
},
|
||||||
on_open = function(term)
|
on_open = function(term)
|
||||||
vim.cmd("startinsert!")
|
vim.cmd("startinsert!")
|
||||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", {noremap = true, silent = true})
|
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||||
end,
|
end,
|
||||||
on_close = function(term)
|
on_close = function()
|
||||||
Terminal:close()
|
Terminal:close()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
function _lazygit_toggle()
|
function _Lazygit_toggle()
|
||||||
lazygit:toggle()
|
lazygit:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<C-g>", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true})
|
vim.api.nvim_set_keymap("n", "<C-g>", "<cmd>lua _Lazygit_toggle()<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
local pnpm =
|
local pnpm =
|
||||||
Terminal:new(
|
Terminal:new(
|
||||||
{
|
{
|
||||||
cmd = "pnpm dev",
|
cmd = "pnpm dev",
|
||||||
dir = "git_dir",
|
dir = "git_dir",
|
||||||
@ -36,46 +35,28 @@ local pnpm =
|
|||||||
on_close = function(term)
|
on_close = function(term)
|
||||||
Terminal:close()
|
Terminal:close()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
function _pnpm_toggle()
|
function _Pnpm_toggle()
|
||||||
pnpm:toggle()
|
pnpm:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>d", "<cmd>lua _pnpm_toggle()<CR>", {noremap = true, silent = true})
|
vim.api.nvim_set_keymap("n", "<Leader>d", "<cmd>lua _Pnpm_toggle()<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
local nvimConfig =
|
|
||||||
Terminal:new(
|
|
||||||
{
|
|
||||||
cmd = "cd $HOME/.dotfiles && nvim configs/init.lua && cd -",
|
|
||||||
direction = "float",
|
|
||||||
on_close = function()
|
|
||||||
Terminal:close()
|
|
||||||
u.ReloadConfig()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
function _nvimConfig_toggle()
|
|
||||||
nvimConfig:toggle()
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader><C-i>", "<cmd>lua _nvimConfig_toggle()<CR>", {noremap = true, silent = true})
|
|
||||||
|
|
||||||
local chtConfig =
|
local chtConfig =
|
||||||
Terminal:new(
|
Terminal:new(
|
||||||
{
|
{
|
||||||
cmd = "cht",
|
cmd = "cht",
|
||||||
direction = "float"
|
direction = "float"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
function _chtConfig_toggle()
|
function _chtConfig_toggle()
|
||||||
chtConfig:toggle()
|
chtConfig:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader><C-l>", "<cmd>lua _chtConfig_toggle()<CR>", {noremap = true, silent = true})
|
vim.api.nvim_set_keymap("n", "<Leader><C-l>", "<cmd>lua _chtConfig_toggle()<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
require("toggleterm").setup {
|
require("toggleterm").setup {
|
||||||
shade_terminals = true
|
shade_terminals = true
|
||||||
|
Loading…
Reference in New Issue
Block a user