Simplify tmux status line and format/save on leaving insert mode in neovim

This commit is contained in:
Daniel Flanagan 2022-07-01 09:47:10 -05:00
parent 1aaf66c3b6
commit a7b62cf22f
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 18 additions and 7 deletions

View file

@ -281,6 +281,14 @@ vim.api.nvim_create_autocmd("TextYankPost", {
end,
})
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
callback = function()
vim.lsp.buf.formatting_seq_sync()
vim.cmd 'write'
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "gitcommit",
callback = function()
@ -323,7 +331,6 @@ local keymap = {
['<leader>k'] = { ':bnext<cr>', m.s },
['<leader>j'] = { ':bprevious<cr>', m.s },
['<leader>s'] = "<cmd>SessionToggle<cr><cmd>echo 'Persisting Session: ' .. g:persisting .. ' (' .. getcwd() .. ')'<cr>",
['<leader>S'] = "<cmd>SessionSave<cr><cmd>echo 'Saved Session: ' .. getcwd()<cr>",
['<leader>l'] = "<cmd>SessionLoad<cr><cmd>echo 'Loaded Session: ' .. getcwd()<cr>",
@ -335,6 +342,7 @@ local keymap = {
['<leader>m'] = '<cmd>lua SynGroup()<cr>',
['<c-q>'] = ':qa<cr>',
['<c-x>'] = ':x<cr>',
['<c-p>'] = '<cmd>Telescope git_files<cr>',
['<c-g>'] = '<cmd>Telescope live_grep<cr>',
@ -375,6 +383,7 @@ local keymap = {
},
i = {
['<c-q>'] = '<esc><c-q>',
['<c-x>'] = '<Esc>:x<cr>',
},
}
for mode, mappings in pairs(keymap) do

View file

@ -40,12 +40,14 @@ set -g window-status-current-style "fg=colour8 bg=colour0"
set -g window-status-format " #W"
set -g window-status-separator ""
set -g window-status-current-format " #W"
set -g status-left "#h:#S #W"
set -g status-right-length 280
set -g status-right "#(kubeline && printf ' ')"
set -ag status-right "#(pwd | $XDG_CONFIG_HOME/lytedev-dotfiles/common/bin/glancepath) "
set -ag status-right "#(cd '#{pane_current_path}' && git rev-parse --abbrev-ref --sq HEAD | tr -d \"'\")"
set -ag status-right "#{pane_current_command}"
set -g status-right ""
set -g status-left "#h:#S #W "
set -ag status-left "#(pwd | $XDG_CONFIG_HOME/lytedev-dotfiles/common/bin/glancepath) "
set -ag status-left "#(cd '#{pane_current_path}' && git rev-parse --abbrev-ref --sq HEAD | tr -d \"'\")"
set -ag status-left "#(kubeline && printf ' ')"
set -g status-left-length 1000
# set -g status-right-length 280
# set -ag status-right "#{pane_current_command}"
set -g message-style "fg=colour7 bg=colour18"
set -g pane-active-border-style bg=black,fg=blue