Simplify tmux status line and format/save on leaving insert mode in neovim
This commit is contained in:
parent
1aaf66c3b6
commit
a7b62cf22f
2 changed files with 18 additions and 7 deletions
|
@ -281,6 +281,14 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
end,
|
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", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "gitcommit",
|
pattern = "gitcommit",
|
||||||
callback = function()
|
callback = function()
|
||||||
|
@ -323,7 +331,6 @@ local keymap = {
|
||||||
['<leader>k'] = { ':bnext<cr>', m.s },
|
['<leader>k'] = { ':bnext<cr>', m.s },
|
||||||
['<leader>j'] = { ':bprevious<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>SessionToggle<cr><cmd>echo 'Persisting Session: ' .. g:persisting .. ' (' .. getcwd() .. ')'<cr>",
|
||||||
['<leader>S'] = "<cmd>SessionSave<cr><cmd>echo 'Saved Session: ' .. getcwd()<cr>",
|
['<leader>S'] = "<cmd>SessionSave<cr><cmd>echo 'Saved Session: ' .. getcwd()<cr>",
|
||||||
['<leader>l'] = "<cmd>SessionLoad<cr><cmd>echo 'Loaded 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>',
|
['<leader>m'] = '<cmd>lua SynGroup()<cr>',
|
||||||
|
|
||||||
['<c-q>'] = ':qa<cr>',
|
['<c-q>'] = ':qa<cr>',
|
||||||
|
['<c-x>'] = ':x<cr>',
|
||||||
|
|
||||||
['<c-p>'] = '<cmd>Telescope git_files<cr>',
|
['<c-p>'] = '<cmd>Telescope git_files<cr>',
|
||||||
['<c-g>'] = '<cmd>Telescope live_grep<cr>',
|
['<c-g>'] = '<cmd>Telescope live_grep<cr>',
|
||||||
|
@ -375,6 +383,7 @@ local keymap = {
|
||||||
},
|
},
|
||||||
i = {
|
i = {
|
||||||
['<c-q>'] = '<esc><c-q>',
|
['<c-q>'] = '<esc><c-q>',
|
||||||
|
['<c-x>'] = '<Esc>:x<cr>',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for mode, mappings in pairs(keymap) do
|
for mode, mappings in pairs(keymap) do
|
||||||
|
|
|
@ -40,12 +40,14 @@ set -g window-status-current-style "fg=colour8 bg=colour0"
|
||||||
set -g window-status-format " #W"
|
set -g window-status-format " #W"
|
||||||
set -g window-status-separator ""
|
set -g window-status-separator ""
|
||||||
set -g window-status-current-format " #W"
|
set -g window-status-current-format " #W"
|
||||||
set -g status-left "#h:#S #W"
|
set -g status-right ""
|
||||||
set -g status-right-length 280
|
set -g status-left "#h:#S #W "
|
||||||
set -g status-right "#(kubeline && printf ' ')"
|
set -ag status-left "#(pwd | $XDG_CONFIG_HOME/lytedev-dotfiles/common/bin/glancepath) "
|
||||||
set -ag status-right "#(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-right "#(cd '#{pane_current_path}' && git rev-parse --abbrev-ref --sq HEAD | tr -d \"'\")"
|
set -ag status-left "#(kubeline && printf ' ')"
|
||||||
set -ag status-right "#{pane_current_command}"
|
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 message-style "fg=colour7 bg=colour18"
|
||||||
set -g pane-active-border-style bg=black,fg=blue
|
set -g pane-active-border-style bg=black,fg=blue
|
||||||
|
|
Reference in a new issue