mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-27 05:41:45 +00:00
Compare commits
7 Commits
37bd546ea8
...
7404b85ee4
Author | SHA1 | Date | |
---|---|---|---|
7404b85ee4 | |||
bb27e773c5 | |||
3efbd7cbd3 | |||
f7e753013c | |||
6e8f9931e0 | |||
8296b55962 | |||
3c7dfc4a3e |
@ -34,6 +34,7 @@
|
|||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||||
|
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
|
||||||
"vim-flog": { "branch": "master", "commit": "6f80c1ffa7068ca8cc0e29af7af4f6ed0717e65e" },
|
"vim-flog": { "branch": "master", "commit": "6f80c1ffa7068ca8cc0e29af7af4f6ed0717e65e" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||||
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },
|
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },
|
||||||
|
@ -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 {
|
return {
|
||||||
{
|
{
|
||||||
'stevearc/oil.nvim',
|
'stevearc/oil.nvim',
|
||||||
-- Optional dependencies
|
-- Optional dependencies
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
config = function()
|
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'
|
local oil = require 'oil'
|
||||||
oil.setup {
|
oil.setup {
|
||||||
view_options = {
|
view_options = {
|
||||||
|
8
lua/custom/plugins/vimbbye.lua
Normal file
8
lua/custom/plugins/vimbbye.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
@ -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' })
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
-- Open terminal in current window
|
-- 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
|
-- Disable arrow keys in normal mode
|
||||||
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
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
|
-- 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' })
|
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
|
-- Switch to between buffers
|
||||||
vim.keymap.set('n', '<leader>bp', '<cmd>bp<cr>', { desc = '[B]uffer [P]revious' })
|
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' })
|
vim.keymap.set('n', '<leader>bn', '<cmd>bn<cr>', { desc = '[B]uffer [N]ext' })
|
||||||
|
@ -8,6 +8,7 @@ return {
|
|||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
javascript = { 'eslint' },
|
javascript = { 'eslint' },
|
||||||
typescript = { 'eslint' },
|
typescript = { 'eslint' },
|
||||||
|
php = { 'eslint' },
|
||||||
markdown = { 'markdownlint' },
|
markdown = { 'markdownlint' },
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ return {
|
|||||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||||
group = lint_augroup,
|
group = lint_augroup,
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint(nil, { ignore_errors = true })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
@ -9,7 +9,7 @@ vim.cmd 'silent! language en_US'
|
|||||||
-- Shell options
|
-- Shell options
|
||||||
-- Sets the shell to use for system() and ! commands in windows
|
-- Sets the shell to use for system() and ! commands in windows
|
||||||
if vim.fn.has 'win32' == 1 and vim.fn.has 'wsl' == 0 then
|
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.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
|
||||||
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
||||||
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||||
|
Loading…
Reference in New Issue
Block a user