Skip to content

Commit

Permalink
tabs and sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghuveer N committed Jul 9, 2023
1 parent cf61ddf commit 37069f2
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nvim/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[ ] - Add tabs support
[ ] - Better Git integration
[x] - Add tabs support
[ ] - Add support for go tests
2 changes: 2 additions & 0 deletions nvim/lua/core/plugin_config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ require('core.plugin_config.git_cs')
require('core.plugin_config.lsp_config')
require('core.plugin_config.completions')
require('core.plugin_config.gitsigns')
require('core.plugin_config.tabs')
require('core.plugin_config.sessions')

7 changes: 7 additions & 0 deletions nvim/lua/core/plugin_config/sessions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
vim.api.nvim_create_autocmd({"VimLeavePre"}, {
callback = function()
if vim.g.project_root ~= nil then
require "neoproj".save_session()
end
end,
})
14 changes: 14 additions & 0 deletions nvim/lua/core/plugin_config/tabs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require('barbar').setup{}

local map = vim.api.nvim_set_keymap
local ops = { noremap = true, silent = true }

map('n', '<C-b>', '<Cmd>BufferPrevious<CR>', ops)
map('n', '<C-n>', '<Cmd>BufferNext<CR>', ops)
map('n', '<C-x>', '<Cmd>BufferClose<CR>', ops)
map('n', '<C-p>', '<Cmd>BufferPin<CR>', ops)
map('n', '<leader>cbr', '<Cmd>BufferCloseBuffersRight<CR>', ops)
map('n', '<leader>cbl', '<Cmd>BufferCloseBuffersLeft<CR>', ops)
map('n', '<leader>cbc', '<Cmd>BufferCloseAllButCurrent<CR>', ops)
map('n', '<A-n>', '<Cmd>BufferMovePrevious<CR>', ops)
map('n', '<A-m>', '<Cmd>BufferMoveNext<CR>', ops)
1 change: 0 additions & 1 deletion nvim/lua/core/plugin_config/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>op', builtin.find_files, {})
vim.keymap.set('n', '<Space>fg', builtin.live_grep, {})
vim.keymap.set('n', '<Space>fh', builtin.help_tags, {})

11 changes: 11 additions & 0 deletions nvim/lua/core/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ return require('packer').startup(function(use)
"hrsh7th/cmp-nvim-lsp",
}
use 'lewis6991/gitsigns.nvim'
-- tabs
use 'romgrk/barbar.nvim'
-- sessions
use({
"pluffie/neoproj",
config = function()
require("neoproj").setup {
project_path = "~/Code"
}
end
})
use({
"Pocco81/auto-save.nvim",
config = function()
Expand Down
15 changes: 15 additions & 0 deletions nvim/plugin/packer_compiled.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ _G.packer_plugins = {
path = "/Users/raghuveernaraharisetti/.local/share/nvim/site/pack/packer/start/auto-save.nvim",
url = "https://github.com/Pocco81/auto-save.nvim"
},
["barbar.nvim"] = {
loaded = true,
path = "/Users/raghuveernaraharisetti/.local/share/nvim/site/pack/packer/start/barbar.nvim",
url = "https://github.com/romgrk/barbar.nvim"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/Users/raghuveernaraharisetti/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
Expand Down Expand Up @@ -120,6 +125,12 @@ _G.packer_plugins = {
path = "/Users/raghuveernaraharisetti/.local/share/nvim/site/pack/packer/start/mellow.nvim",
url = "https://github.com/kvrohit/mellow.nvim"
},
neoproj = {
config = { "\27LJ\2\nP\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\17project_path\v~/Code\nsetup\fneoproj\frequire\0" },
loaded = true,
path = "/Users/raghuveernaraharisetti/.local/share/nvim/site/pack/packer/start/neoproj",
url = "https://github.com/pluffie/neoproj"
},
["nvim-cmp"] = {
loaded = true,
path = "/Users/raghuveernaraharisetti/.local/share/nvim/site/pack/packer/start/nvim-cmp",
Expand Down Expand Up @@ -163,6 +174,10 @@ _G.packer_plugins = {
}

time([[Defining packer_plugins]], false)
-- Config for: neoproj
time([[Config for neoproj]], true)
try_loadstring("\27LJ\2\nP\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\17project_path\v~/Code\nsetup\fneoproj\frequire\0", "config", "neoproj")
time([[Config for neoproj]], false)
-- Config for: auto-save.nvim
time([[Config for auto-save.nvim]], true)
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14auto-save\frequire\0", "config", "auto-save.nvim")
Expand Down

0 comments on commit 37069f2

Please sign in to comment.