Compare commits
1 Commits
7b9545f811
...
6dfbb4ec22
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
6dfbb4ec22 |
@@ -118,12 +118,6 @@ Tasks integrate with quickfix: errors populate the quickfix list.
|
|||||||
|
|
||||||
Auto-installed servers: `gopls`, `bashls`, `ansiblels`, `yamlls`.
|
Auto-installed servers: `gopls`, `bashls`, `ansiblels`, `yamlls`.
|
||||||
|
|
||||||
## Plugins
|
|
||||||
|
|
||||||
| Command | Action |
|
|
||||||
|---------|--------|
|
|
||||||
| `:lua vim.pack.update()` | Update all plugins |
|
|
||||||
|
|
||||||
## Treesitter
|
## Treesitter
|
||||||
|
|
||||||
| Command | Action |
|
| Command | Action |
|
||||||
|
|||||||
@@ -6,35 +6,6 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Quit Neovim if only oil windows remain (skip during startup)
|
|
||||||
_G._nvim_ready = false
|
|
||||||
vim.api.nvim_create_autocmd("VimEnter", {
|
|
||||||
group = vim.api.nvim_create_augroup("nvim_ready_flag", { clear = true }),
|
|
||||||
callback = function()
|
|
||||||
vim.schedule(function() _G._nvim_ready = true end)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
function _G.quit_if_only_oil()
|
|
||||||
vim.schedule(function()
|
|
||||||
if not _G._nvim_ready then return end
|
|
||||||
for _, win in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
|
|
||||||
if vim.api.nvim_win_get_config(win).relative == "" then
|
|
||||||
local buf = vim.api.nvim_win_get_buf(win)
|
|
||||||
local ft = vim.bo[buf].filetype
|
|
||||||
local name = vim.api.nvim_buf_get_name(buf)
|
|
||||||
if ft ~= "oil" and name ~= "" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if ft ~= "oil" and name == "" and vim.bo[buf].modified then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
vim.cmd("qa")
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Buffer tab navigation (per-window, exclusive)
|
-- Buffer tab navigation (per-window, exclusive)
|
||||||
local function cycle_buf(dir)
|
local function cycle_buf(dir)
|
||||||
local bufs = _G.get_win_bufs()
|
local bufs = _G.get_win_bufs()
|
||||||
@@ -67,16 +38,9 @@ vim.keymap.set("n", "<leader>x", function()
|
|||||||
vim.bo.bufhidden = "wipe"
|
vim.bo.bufhidden = "wipe"
|
||||||
end
|
end
|
||||||
vim.cmd("bdelete " .. current)
|
vim.cmd("bdelete " .. current)
|
||||||
_G.quit_if_only_oil()
|
|
||||||
end, { desc = "Close buffer tab" })
|
end, { desc = "Close buffer tab" })
|
||||||
|
|
||||||
|
|
||||||
-- Also check when a window is closed (e.g. :q)
|
|
||||||
vim.api.nvim_create_autocmd("WinClosed", {
|
|
||||||
group = vim.api.nvim_create_augroup("quit_if_only_oil_winclose", { clear = true }),
|
|
||||||
callback = function() _G.quit_if_only_oil() end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Prevent splitting from oil — redirect to last code window
|
-- Prevent splitting from oil — redirect to last code window
|
||||||
vim.api.nvim_create_autocmd("WinNew", {
|
vim.api.nvim_create_autocmd("WinNew", {
|
||||||
group = vim.api.nvim_create_augroup("no_split_oil", { clear = true }),
|
group = vim.api.nvim_create_augroup("no_split_oil", { clear = true }),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ vim.pack.add({
|
|||||||
"https://github.com/nvim-treesitter/nvim-treesitter",
|
"https://github.com/nvim-treesitter/nvim-treesitter",
|
||||||
"https://github.com/williamboman/mason.nvim",
|
"https://github.com/williamboman/mason.nvim",
|
||||||
"https://github.com/williamboman/mason-lspconfig.nvim",
|
"https://github.com/williamboman/mason-lspconfig.nvim",
|
||||||
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range("1.*"), build = "cargo build --release" },
|
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range("1.*") },
|
||||||
"https://github.com/stevearc/oil.nvim",
|
"https://github.com/stevearc/oil.nvim",
|
||||||
"https://github.com/stevearc/overseer.nvim",
|
"https://github.com/stevearc/overseer.nvim",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"blink.cmp": {
|
"blink.cmp": {
|
||||||
"rev": "451168851e8e2466bc97ee3e026c3dcb9141ce07",
|
"rev": "e9556f9b981f395e22a6bfd69fd5f3008a2a6cd9",
|
||||||
"src": "https://github.com/saghen/blink.cmp",
|
"src": "https://github.com/saghen/blink.cmp",
|
||||||
"version": "1.0.0 - 2.0.0"
|
"version": "1.0.0 - 2.0.0"
|
||||||
},
|
},
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"src": "https://github.com/rebelot/kanagawa.nvim"
|
"src": "https://github.com/rebelot/kanagawa.nvim"
|
||||||
},
|
},
|
||||||
"mason-lspconfig.nvim": {
|
"mason-lspconfig.nvim": {
|
||||||
"rev": "a676ab7282da8d651e175118bcf54483ca11e46d",
|
"rev": "a324581a3c83fdacdb9804b79de1cbe00ce18550",
|
||||||
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||||
},
|
},
|
||||||
"mason.nvim": {
|
"mason.nvim": {
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
"src": "https://github.com/williamboman/mason.nvim"
|
"src": "https://github.com/williamboman/mason.nvim"
|
||||||
},
|
},
|
||||||
"nvim-lspconfig": {
|
"nvim-lspconfig": {
|
||||||
"rev": "dc2f86d2b66a6e01a98c37cdadd3be3e90f8ab9a",
|
"rev": "2b87d107942b9eebef768512f5849330335a9493",
|
||||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
"nvim-treesitter": {
|
"nvim-treesitter": {
|
||||||
"rev": "2cc172c28e5550e00e6beead4599b1469469c1c7",
|
"rev": "1970f0d3bbb99c7659e58914948749437c7b7398",
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
},
|
},
|
||||||
"oil.nvim": {
|
"oil.nvim": {
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
"src": "https://github.com/stevearc/oil.nvim"
|
"src": "https://github.com/stevearc/oil.nvim"
|
||||||
},
|
},
|
||||||
"overseer.nvim": {
|
"overseer.nvim": {
|
||||||
"rev": "a2194447f4c5a1baf95139c5c7b539fa7b0d012f",
|
"rev": "2802c15182dae2de71f9c82e918d7ba850b90c22",
|
||||||
"src": "https://github.com/stevearc/overseer.nvim"
|
"src": "https://github.com/stevearc/overseer.nvim"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
95
session.vim
95
session.vim
@@ -1,95 +0,0 @@
|
|||||||
let SessionLoad = 1
|
|
||||||
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
|
|
||||||
let v:this_session=expand("<sfile>:p")
|
|
||||||
doautoall SessionLoadPre
|
|
||||||
silent only
|
|
||||||
cd ~
|
|
||||||
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
|
|
||||||
let s:wipebuf = bufnr('%')
|
|
||||||
endif
|
|
||||||
let s:shortmess_save = &shortmess
|
|
||||||
set shortmess+=aoO
|
|
||||||
badd +1 ~/Projects/Referit-Monitoring/devops/azure-pipeline.yml
|
|
||||||
badd +1 ~/Projects/Referit-Monitoring/devops/jobs/deploy-bicep.yml
|
|
||||||
badd +1 ~/Projects/Referit-Monitoring/devops/jobs/detect-changes.yml
|
|
||||||
argglobal
|
|
||||||
%argdel
|
|
||||||
edit ~/Projects/Referit-Monitoring/devops/jobs/detect-changes.yml
|
|
||||||
let s:save_splitbelow = &splitbelow
|
|
||||||
let s:save_splitright = &splitright
|
|
||||||
set splitbelow splitright
|
|
||||||
wincmd _ | wincmd |
|
|
||||||
vsplit
|
|
||||||
1wincmd h
|
|
||||||
wincmd w
|
|
||||||
let &splitbelow = s:save_splitbelow
|
|
||||||
let &splitright = s:save_splitright
|
|
||||||
wincmd t
|
|
||||||
let s:save_winminheight = &winminheight
|
|
||||||
let s:save_winminwidth = &winminwidth
|
|
||||||
set winminheight=0
|
|
||||||
set winheight=1
|
|
||||||
set winminwidth=0
|
|
||||||
set winwidth=1
|
|
||||||
wincmd =
|
|
||||||
argglobal
|
|
||||||
balt ~/Projects/Referit-Monitoring/devops/jobs/deploy-bicep.yml
|
|
||||||
setlocal foldmethod=manual
|
|
||||||
setlocal foldexpr=0
|
|
||||||
setlocal foldmarker={{{,}}}
|
|
||||||
setlocal foldignore=#
|
|
||||||
setlocal foldlevel=0
|
|
||||||
setlocal foldminlines=1
|
|
||||||
setlocal foldnestmax=20
|
|
||||||
setlocal foldenable
|
|
||||||
silent! normal! zE
|
|
||||||
let &fdl = &fdl
|
|
||||||
let s:l = 56 - ((55 * winheight(0) + 36) / 73)
|
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
|
||||||
keepjumps exe s:l
|
|
||||||
normal! zt
|
|
||||||
keepjumps 56
|
|
||||||
normal! 08|
|
|
||||||
wincmd w
|
|
||||||
argglobal
|
|
||||||
if bufexists(fnamemodify("~/Projects/Referit-Monitoring/devops/azure-pipeline.yml", ":p")) | buffer ~/Projects/Referit-Monitoring/devops/azure-pipeline.yml | else | edit ~/Projects/Referit-Monitoring/devops/azure-pipeline.yml | endif
|
|
||||||
if &buftype ==# 'terminal'
|
|
||||||
silent file ~/Projects/Referit-Monitoring/devops/azure-pipeline.yml
|
|
||||||
endif
|
|
||||||
balt ~/Projects/Referit-Monitoring/devops/jobs/detect-changes.yml
|
|
||||||
setlocal foldmethod=manual
|
|
||||||
setlocal foldexpr=0
|
|
||||||
setlocal foldmarker={{{,}}}
|
|
||||||
setlocal foldignore=#
|
|
||||||
setlocal foldlevel=0
|
|
||||||
setlocal foldminlines=1
|
|
||||||
setlocal foldnestmax=20
|
|
||||||
setlocal foldenable
|
|
||||||
silent! normal! zE
|
|
||||||
let &fdl = &fdl
|
|
||||||
let s:l = 1 - ((0 * winheight(0) + 36) / 73)
|
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
|
||||||
keepjumps exe s:l
|
|
||||||
normal! zt
|
|
||||||
keepjumps 1
|
|
||||||
normal! 0
|
|
||||||
wincmd w
|
|
||||||
wincmd =
|
|
||||||
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
|
|
||||||
silent exe 'bwipe ' . s:wipebuf
|
|
||||||
endif
|
|
||||||
unlet! s:wipebuf
|
|
||||||
set winheight=1 winwidth=20
|
|
||||||
let &shortmess = s:shortmess_save
|
|
||||||
let &winminheight = s:save_winminheight
|
|
||||||
let &winminwidth = s:save_winminwidth
|
|
||||||
let s:sx = expand("<sfile>:p:r")."x.vim"
|
|
||||||
if filereadable(s:sx)
|
|
||||||
exe "source " . fnameescape(s:sx)
|
|
||||||
endif
|
|
||||||
let &g:so = s:so_save | let &g:siso = s:siso_save
|
|
||||||
set hlsearch
|
|
||||||
nohlsearch
|
|
||||||
doautoall SessionLoadPost
|
|
||||||
unlet SessionLoad
|
|
||||||
" vim: set ft=vim :
|
|
||||||
Reference in New Issue
Block a user