Compare commits

...

3 commits

Author SHA1 Message Date
bcfd9372dc
nvim: fugitive: Add mapping to view file on another branch 2024-11-28 11:29:50 +05:30
036b6652a9
nvim: lsp: Do not attach LSP if file is opened via git
We might use Git show to view git revision of the file
on another branch and we do not want to attach LSP to
this file. This file will be opened as a temporary with
path /tmp/nvim/<something>.

On similar lines to commit 1eec783a20.
2024-11-28 11:29:50 +05:30
e3ff05fa11
sway: Do not specify Pictures directory explicitly 2024-11-27 21:39:47 +05:30
4 changed files with 16 additions and 2 deletions

View file

@ -36,6 +36,7 @@ nnoremap <Leader>G :keepalt Git<SPACE>
nnoremap <Leader>gp :call git#git_push_to_upstream()<CR>
nnoremap <expr> <Leader>gP git#git_push()
nnoremap <expr> <Leader>gO git#git_show_file_on_branch()
augroup custom_fugitive
autocmd!

View file

@ -289,6 +289,11 @@ function! git#git_review_fileview() abort
execute "Git difftool -y " . default[3] . "..." . current
endfunction
" Show file on another branch without changing current branch
function! git#git_show_file_on_branch() abort
return ":Git show :" . expand("%")
endfunction
" Generate a helpful name when using Git stash
function! git#git_stash() abort
let current = trim(system("git branch --show-current"))

View file

@ -264,6 +264,10 @@ vim.api.nvim_create_autocmd("LspAttach", {
return
end
if string.find(file_name, "/tmp/") then
return
end
for _, mappings in pairs(lsp_key_mappings) do
local capability, mode, lhs, rhs = unpack(mappings)
if client.supports_method(capability) then
@ -286,6 +290,10 @@ vim.api.nvim_create_autocmd("LspDetach", {
return
end
if string.find(file_name, "/tmp/") then
return
end
for _, mappings in pairs(lsp_key_mappings) do
local capability, mode, lhs, _ = unpack(mappings)
if client.supports_method(capability) then

View file

@ -4,8 +4,8 @@ set $next bracketright
set $term alacritty
set $alt_term foot
set $menu fuzzel
set $screenshot grim ~/Pictures/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $screenclip slurp | grim -g - ~/Pictures/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $screenshot grim $(xdg-user-dir PICTURES)/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $screenclip slurp | grim -g - $(xdg-user-dir PICTURES)/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $lock swaylock
set $color_urgent #cc241d