Compare commits

...

13 Commits

9 changed files with 165 additions and 25 deletions

22
.bashrc
View File

@ -98,6 +98,10 @@ export FZF_DEFAULT_OPTS=" \
--color=fg:#4c4f69,header:#d20f39,info:#8839ef,pointer:#dc8a78 \
--color=marker:#dc8a78,fg+:#4c4f69,prompt:#8839ef,hl+:#d20f39"
# Override this in .bashrc_local if a nerd font is installed locally.
export HAVE_NERD_FONT=false
export HIDE_HOSTNAME=false
# Add a local un-tracked bash-rc if present
if [[ -f ${HOME}/.bashrc_local ]];
then
@ -144,6 +148,14 @@ else
c_git_dirty=
fi
prev_status_prompt_minimal () {
status=$?
if [ $status -ne 0 ]; then
red=`tput setaf 1; tput bold`
echo "${red}${status}${c_reset} "
fi
}
prev_status_prompt () {
status=$?
if [ $status -ne 0 ]; then
@ -162,7 +174,15 @@ git_prompt () {
echo " -- $git_branch"
}
if [ "$BASH" != "" ]; then
if [ "$BASH" != "" ] && [ "$TMUX" != "" ]; then
h="\h"
if [ $HIDE_HOSTNAME = true ]; then
h=""
fi
# In tmux, hide the path and gitprompt and reduce to one line.
PS1="\n\$(prev_status_prompt_minimal)${h}󰅂 "
elif [ "$BASH" != "" ]; then
# Prompt
PS1="\n╔ \w\$(prev_status_prompt)\$(git_prompt) -- \$(date '+%y-%m-%dT%H:%M:%S')\n╚ \h\$ "
fi

10
.gitmux.conf Normal file
View File

@ -0,0 +1,10 @@
# https://github.com/arl/gitmux/blob/main/README.md#customizing
tmux:
layout: [branch, divergence, " - ", flags]
styles:
branch: '#[fg=cyan,bold]'
options:
branch_max_len: 25
branch_trim: right
ellipsis: …
hide_clean: true

View File

@ -1,4 +1,5 @@
set-option -g status on
set-option -g status-position top
set-option -g status-interval 2
set-option -g renumber-windows on
set-option -g history-limit 10000
@ -17,7 +18,7 @@ bind-key r source-file ~/.tmux.conf\; display-message "Reloaded config"
bind-key m set-window-option mouse\; display-message "mouse support is now #{?mouse,on,off}"
### Open LazyGit in a popup
bind-key g display-popup -E -w 90% -h 90% lazygit
bind-key g display-popup -E -d '#{pane_current_path}' -w 90% -h 90% lazygit
# New panes and windows have same cwd as the one opening it
bind c new-window -c "#{pane_current_path}"
@ -59,11 +60,11 @@ set -g @catppuccin_window_middle_separator ""
set -g @catppuccin_window_right_separator "█ "
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_default_fill "number"
# set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,  ,}"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_status_modules_right "directory date_time session"
set -g @catppuccin_directory_text "#{pane_current_path}"
set -g @catppuccin_status_modules_right "directory gitmux session"
set -g @catppuccin_directory_text "#( echo \#{pane_current_path} | sed \"s|$HOME|~|\" )"
set -g @catppuccin_gitmux_text "#(gitmux -cfg $HOME/.gitmux.conf \"#{pane_current_path}\")"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_window_status_enable "no"

1
bin/linux/gitmux Symbolic link
View File

@ -0,0 +1 @@
gitmux_v0.10.4

BIN
bin/linux/gitmux_v0.10.4 Executable file

Binary file not shown.

View File

@ -71,6 +71,9 @@ function performSetup() {
echo "Installing tmux plugins"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "Linking gitmux..."
linkFile ".gitmux.conf"
echo "Linking neovim config"
ln -fns ${DOTFILES_DIR}/nvim ~/.config/nvim

View File

@ -147,6 +147,22 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- [[ Utility functions ]]
-- Retreive selected text from the editor.
function vim.getVisualSelection()
vim.cmd 'noau normal! "vy"'
local text = vim.fn.getreg 'v'
vim.fn.setreg('v', {})
text = string.gsub(text, '\n', '')
if #text > 0 then
return text
else
return ''
end
end
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
@ -280,11 +296,20 @@ require('lazy').setup({
-- You can put your default mappings / updates / etc. in here
-- All the info you're looking for is in `:help telescope.setup()`
--
-- defaults = {
-- mappings = {
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
-- },
-- },
defaults = {
mappings = {
n = {
-- Add action to delete a buffer from the Telescope list
['<c-d>'] = require('telescope.actions').delete_buffer,
},
i = {
-- ['<c-enter>'] = 'to_fuzzy_refine',
-- Add action to delete a buffer from the Telescope list
['<c-d>'] = require('telescope.actions').delete_buffer,
},
},
},
-- pickers = {}
extensions = {
['ui-select'] = {
@ -316,6 +341,13 @@ require('lazy').setup({
}
end, { desc = '[S]earch Recent Files in CWD' })
vim.keymap.set('v', '<leader>g', function()
builtin.grep_string {
search = vim.getVisualSelection(),
prompt_title = 'Grep all files',
}
end, { desc = '[G]rep everywhere' })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
@ -628,6 +660,12 @@ require('lazy').setup({
luasnip.config.setup {}
cmp.setup {
window = {
-- Optionally add a border to the completions windows.
-- Does not affect the <shift>-k window.
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
@ -733,6 +771,14 @@ require('lazy').setup({
telescope = true,
which_key = true,
},
custom_highlights = function(C)
return {
WinSeparator = { fg = C.pink },
NormalFloat = { bg = C.crust },
Pmenu = { bg = C.crust },
PmenuSel = { fg = C.text, bg = C.surface0, style = { 'bold' } },
}
end,
},
init = function()
vim.cmd.colorscheme 'catppuccin'
@ -760,20 +806,10 @@ require('lazy').setup({
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()
-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
-- Startup dashboard
require('mini.starter').setup {
footer = '',
}
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
@ -783,7 +819,7 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'sql', 'go', 'typescript', 'javascript' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {

View File

@ -0,0 +1,11 @@
-- UI for working with databases from within vim.
-- https://github.com/tpope/vim-dadbod
-- https://github.com/kristijanhusak/vim-dadbod-ui
return {
'tpope/vim-dadbod',
dependencies = {
'kristijanhusak/vim-dadbod-ui',
'kristijanhusak/vim-dadbod-completion',
},
config = function() end,
}

View File

@ -0,0 +1,58 @@
-- Highly configurable status line
-- https://github.com/nvim-lualine/lualine.nvim
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
theme = 'catppuccin',
icons_enabled = true,
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'diagnostics' },
lualine_c = {
{
'filename',
file_status = true, -- Displays file status (readonly status, modified status)
newfile_status = true, -- Display new file status (new file means no write after created)
path = 1, -- Relative path
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
symbols = {
modified = '󰽂', -- Text to show when the file is modified.
readonly = '', -- Text to show when the file is non-modifiable or readonly.
unnamed = '[No Name]', -- Text to show for unnamed buffers.
newfile = '', -- Text to show for newly created file before first write
},
},
},
lualine_x = { 'fileformat', 'filetype' },
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {
{
'filename',
file_status = true, -- Displays file status (readonly status, modified status)
newfile_status = true, -- Display new file status (new file means no write after created)
path = 1, -- Relative path
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
symbols = {
modified = '󰽂', -- Text to show when the file is modified.
readonly = '', -- Text to show when the file is non-modifiable or readonly.
unnamed = '[No Name]', -- Text to show for unnamed buffers.
newfile = '', -- Text to show for newly created file before first write
},
},
},
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {},
},
},
}