Compare commits

...

7 Commits

6 changed files with 26 additions and 22 deletions

View File

@ -34,6 +34,7 @@
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
"vim-flog": { "branch": "master", "commit": "6f80c1ffa7068ca8cc0e29af7af4f6ed0717e65e" },
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },

View File

@ -1,19 +1,19 @@
-- Fix oil absolute path to relative path conversion
vim.api.nvim_create_augroup('OilRelPathFix', {})
vim.api.nvim_create_autocmd('BufLeave', {
group = 'OilRelPathFix',
pattern = 'oil:///*',
callback = function()
vim.cmd 'cd .'
end,
})
return {
{
'stevearc/oil.nvim',
-- Optional dependencies
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
-- Fix oil absolute path to relative path conversion
vim.api.nvim_create_augroup('OilRelPathFix', {})
vim.api.nvim_create_autocmd('BufLeave', {
group = 'OilRelPathFix',
pattern = 'oil:///*',
callback = function()
vim.cmd 'cd .'
end,
})
local oil = require 'oil'
oil.setup {
view_options = {

View File

@ -0,0 +1,8 @@
return {
{
'moll/vim-bbye',
config = function()
vim.keymap.set('n', '<leader>bd', '<cmd>Bdelete<cr>', { desc = '[B]uffer [D]elete' })
end,
},
}

View File

@ -16,7 +16,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setqflist, { desc = 'Open diagno
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- Open terminal in current window
vim.keymap.set({ 'n', 'v' }, '<leader>to', '<cmd>term<cr>', { desc = '[T]erminal [O]pen' })
local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1
local shellname = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell'
local cond_str = use_ps and (' ' .. shellname .. '.exe') or ''
vim.keymap.set({ 'n', 'v' }, '<leader>to', '<cmd>term' .. cond_str .. '<cr>', { desc = '[T]erminal [O]pen' })
-- Disable arrow keys in normal mode
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
@ -42,15 +45,6 @@ vim.keymap.set('n', '<leader>cdh', '<cmd>cd ' .. vim.env.HOME .. '<cr>', { desc
-- Automatically navigate to config directory
vim.keymap.set('n', '<leader>cdn', '<cmd>cd ' .. vim.fn.stdpath 'config' .. '<cr>', { desc = '[C]hange [D]irectory to [N]eovim' })
-- Delete current buffer without closing window
vim.keymap.set('n', '<leader>bd', function()
-- Get current buffer
local buf = vim.api.nvim_get_current_buf()
-- Switch to different buffer
vim.cmd 'silent! :exe "norm \\<C-6>"'
-- Delete saved buffer
vim.api.nvim_buf_delete(buf, {})
end, { desc = '[B]uffer [D]elete' })
-- Switch to between buffers
vim.keymap.set('n', '<leader>bp', '<cmd>bp<cr>', { desc = '[B]uffer [P]revious' })
vim.keymap.set('n', '<leader>bn', '<cmd>bn<cr>', { desc = '[B]uffer [N]ext' })

View File

@ -8,6 +8,7 @@ return {
lint.linters_by_ft = {
javascript = { 'eslint' },
typescript = { 'eslint' },
php = { 'eslint' },
markdown = { 'markdownlint' },
}
@ -17,7 +18,7 @@ return {
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
lint.try_lint(nil, { ignore_errors = true })
end,
})
end,

View File

@ -9,7 +9,7 @@ vim.cmd 'silent! language en_US'
-- Shell options
-- Sets the shell to use for system() and ! commands in windows
if vim.fn.has 'win32' == 1 and vim.fn.has 'wsl' == 0 then
vim.opt.shell = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell'
vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell'
vim.opt.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'