Formatting, remove outdated plugins, add dadbod-ui
This commit is contained in:
parent
882edc9709
commit
36f68c6ab1
133
init.lua
133
init.lua
|
@ -1,8 +1,5 @@
|
|||
-- Do fast startup if we can
|
||||
do
|
||||
local ok, _ = pcall(require, 'impatient')
|
||||
if not ok then vim.notify('impatient unavailable') end
|
||||
end
|
||||
-- Enable experimental faster module loader
|
||||
vim.loader.enable()
|
||||
|
||||
---- Built in settings ----
|
||||
-- Create a convenient aliases
|
||||
|
@ -15,12 +12,13 @@ local opt = vim.opt
|
|||
local workman = false
|
||||
|
||||
-- Set font
|
||||
o.guifont = 'Iosevka Term Slab,Iosevka:h10'
|
||||
o.guifont = 'IosevkaTermSlab Nerd Font,IosevkaTerm Nerd Font,Iosevka Term Slab,Iosevka:h10:#e-subpixelantialias'
|
||||
vim.g.neovide_floating_z_height = 1
|
||||
if fn.hostname() == 'tappy' then
|
||||
g.neovide_refresh_rate = 144
|
||||
end
|
||||
|
||||
opt.guicursor:append('a:blinkon1000') -- Blink cursor once a second for all modes
|
||||
opt.guicursor:append('a:blinkon1000-blinkoff1000-blinkwait1000') -- Blink cursor once a second for all modes
|
||||
o.mouse = 'a' -- Enable mouse input
|
||||
o.termguicolors = true -- Enable 24bit terminal colors
|
||||
g.neovide_confirm_quit = 1 -- Confirm closing neovide window when changes are unsaved
|
||||
|
@ -30,6 +28,9 @@ o.clipboard = 'unnamedplus' -- Use system clipboard by default
|
|||
o.hidden = true -- Allow buffers to not be attached to a window
|
||||
o.linebreak = true -- Enable word-wrapping at the end of visual lines
|
||||
o.breakindent = true -- preserve indentention on lines continuing from a wrap
|
||||
opt.breakindentopt = {
|
||||
sbr = true -- Line break character should appear before virtual indentention
|
||||
}
|
||||
o.hlsearch = true -- Highlight search results
|
||||
o.scrolloff = 5 -- Margin between cursor and screen top/bottom
|
||||
o.showmatch = true -- Highlight matching brackets
|
||||
|
@ -103,6 +104,9 @@ function _G.zoom(delta)
|
|||
local properties = {
|
||||
title = 'Font size',
|
||||
hide_from_history = true,
|
||||
on_close = function()
|
||||
zoom_notification = nil
|
||||
end
|
||||
}
|
||||
if zoom_notification ~= nil then
|
||||
properties.replace = zoom_notification.id
|
||||
|
@ -277,7 +281,6 @@ require'packer'.startup(function(use)
|
|||
|
||||
-- Filetype plugins --
|
||||
use 'rhysd/vim-crystal'
|
||||
use 'editorconfig/editorconfig-vim'
|
||||
use 'bakpakin/fennel.vim'
|
||||
use 'mboughaba/i3config.vim'
|
||||
use 'plasticboy/vim-markdown'
|
||||
|
@ -285,22 +288,31 @@ require'packer'.startup(function(use)
|
|||
use 'lifepillar/pgsql.vim'
|
||||
use 'ajouellette/sway-vim-syntax'
|
||||
use 'cespare/vim-toml'
|
||||
use 'rust-lang/rust.vim'
|
||||
|
||||
-- Editing --
|
||||
use 'LunarWatcher/auto-pairs'
|
||||
use 'ojroques/nvim-bufdel'
|
||||
use {'stevearc/conform.nvim', config = function()
|
||||
require'conform'.setup {}
|
||||
require'conform'.setup {
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
filter = function(client)
|
||||
return client.name == 'rust-analyzer'
|
||||
end
|
||||
}
|
||||
}
|
||||
vim.api.nvim_create_user_command(
|
||||
'Conform',
|
||||
function()
|
||||
require'conform'.format()
|
||||
require'conform'.format {
|
||||
lsp_fallback = true,
|
||||
}
|
||||
end,
|
||||
{}
|
||||
{
|
||||
desc = 'Format buffer',
|
||||
}
|
||||
)
|
||||
end}
|
||||
--use 'yuttie/comfortable-motion.vim'
|
||||
use {'jbyuki/instant.nvim', config = function()
|
||||
vim.g.instant_username = 'agraven'
|
||||
end}
|
||||
|
@ -317,8 +329,6 @@ require'packer'.startup(function(use)
|
|||
end}
|
||||
use 'tpope/vim-repeat'
|
||||
use 'tpope/vim-sleuth'
|
||||
-- spellsitter: syntax aware spellchecking
|
||||
use {'lewis6991/spellsitter.nvim', config = function() require'spellsitter'.setup() end}
|
||||
use 'tpope/vim-surround'
|
||||
use {'vim-test/vim-test', config = function()
|
||||
vim.g['test#neovim#term_position'] = 'vert'
|
||||
|
@ -368,10 +378,14 @@ require'packer'.startup(function(use)
|
|||
-- UI elements --
|
||||
use 'vim-airline/vim-airline'
|
||||
use 'vim-airline/vim-airline-themes'
|
||||
use {'taketwo/barbar.nvim', branch = 'schedule-wrap'}
|
||||
use 'romgrk/barbar.nvim'
|
||||
use {'luckasRanarison/clear-action.nvim', config = function()
|
||||
require'clear-action'.setup {
|
||||
signs = { enable = false },
|
||||
signs = {
|
||||
enable = true,
|
||||
combine = true,
|
||||
show_count = false,
|
||||
},
|
||||
popup = { enable = true },
|
||||
}
|
||||
end}
|
||||
|
@ -379,6 +393,20 @@ require'packer'.startup(function(use)
|
|||
vim.g.bookmark_no_default_key_mappings = 1
|
||||
vim.g.bookmark_save_per_working_dir = 1
|
||||
end}
|
||||
use {'kristijanhusak/vim-dadbod-ui', requires = {'tpope/vim-dadbod', 'kristijanhusak/vim-dadbod-completion'}, config = function()
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
vim.g.db_ui_auto_execute_table_helpers = 1
|
||||
vim.g.db_ui_win_position = 'right'
|
||||
vim.o.previewheight = 40
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
group = 'luarc',
|
||||
pattern = {'sql','mysql','plsql'},
|
||||
callback = function()
|
||||
require('cmp').setup.buffer({ sources = {{ name = 'vim-dadbod-completion' }} })
|
||||
end,
|
||||
desc = 'SQL dadbod completion',
|
||||
})
|
||||
end}
|
||||
use {'mfussenegger/nvim-dap', config = function()
|
||||
local dap = require'dap'
|
||||
vim.fn.sign_define('DapBreakpoint', {text = '⯃', texthl = 'DiagnosticError'})
|
||||
|
@ -533,7 +561,7 @@ require'packer'.startup(function(use)
|
|||
enhanced_diff_hl = true,
|
||||
}
|
||||
end}
|
||||
use {'stevearc/dressing.nvim', config = function()
|
||||
use {'stevearc/dressing.nvim', after = 'telescope.nvim', config = function()
|
||||
vim.cmd'highlight link FloatTitle TelescopeBorder'
|
||||
require'dressing'.setup {
|
||||
input = {
|
||||
|
@ -596,9 +624,18 @@ require'packer'.startup(function(use)
|
|||
end}
|
||||
use {'stevearc/overseer.nvim', after = 'nvim-dap', config = function()
|
||||
require'overseer'.setup()
|
||||
vim.keymap.set('n', '<Leader>rr', '<Cmd>OverseerToggle right<CR>', { desc = "Open" })
|
||||
vim.keymap.set('n', '<Leader>rn', '<Cmd>OverseerRun<CR>', { desc = "New task" })
|
||||
vim.keymap.set('n', '<Leader>rc', '<Cmd>OverseerRunCmd<CR>', { desc = "Run shell command" })
|
||||
require'which-key'.register {
|
||||
['<Leader>r'] = {
|
||||
name = 'Overseer (run tasks)',
|
||||
r = {'<Cmd>OverseerToggle right<CR>', 'Open' },
|
||||
R = {'<Cmd>OverseerToggle bottom<CR>', 'Open (bottom)' },
|
||||
n = {'<Cmd>OverseerRun<CR>', 'New task' },
|
||||
c = {'<Cmd>OverseerRunCmd<CR>', 'Run shell command' },
|
||||
l = {'<Cmd>OverseerLoadBundle!<CR>', 'Load task list'},
|
||||
L = {'<Cmd>OverseerLoadBundle<CR>', 'Load and start task list'},
|
||||
s = {'<Cmd>OverseerSaveBundle<CR>', 'Save task list'}
|
||||
}
|
||||
}
|
||||
end}
|
||||
use 'mhinz/vim-startify'
|
||||
use {'nvim-telescope/telescope.nvim', after = 'which-key.nvim', config = function()
|
||||
|
@ -649,8 +686,8 @@ require'packer'.startup(function(use)
|
|||
function()
|
||||
vim.ui.input(
|
||||
{ completion = 'dir' },
|
||||
function(input) telescope.builtin.find_files { search_dirs = {input} }
|
||||
end)
|
||||
function(input) telescope.builtin.find_files { search_dirs = {input} } end
|
||||
)
|
||||
end,
|
||||
'Files in subdirectory'
|
||||
},
|
||||
|
@ -689,7 +726,7 @@ require'packer'.startup(function(use)
|
|||
require'telescope'.load_extension('ui-select')
|
||||
end}
|
||||
use {'nvim-telescope/telescope-dap.nvim', after = 'telescope.nvim', config = function()
|
||||
require'telescope'.load_extension'dap'
|
||||
require'telescope'.load_extension('dap')
|
||||
end}
|
||||
use {'debugloop/telescope-undo.nvim', after = 'telescope.nvim', config = function()
|
||||
require'telescope'.load_extension('undo')
|
||||
|
@ -703,17 +740,13 @@ require'packer'.startup(function(use)
|
|||
}
|
||||
end}
|
||||
use 'kyazdani42/nvim-tree.lua'
|
||||
use 'simrat39/symbols-outline.nvim'
|
||||
use 'hedyhli/outline.nvim'
|
||||
use {'folke/which-key.nvim', config = function() require'which-key'.setup() end}
|
||||
|
||||
-- Utility and libraries
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'ryanoasis/vim-devicons'
|
||||
use 'kyazdani42/nvim-web-devicons'
|
||||
if not vim.fn.has('nvim-0.8') then
|
||||
use 'antoinemadec/FixCursorHold.nvim'
|
||||
end
|
||||
use 'lewis6991/impatient.nvim' -- speeds up load times
|
||||
use {'ellisonleao/dotenv.nvim', config = function()
|
||||
require'dotenv'.setup {
|
||||
enable_on_load = false,
|
||||
|
@ -772,19 +805,29 @@ require'which-key'.register {
|
|||
['<A-b>'] = {'<Cmd>BufferPick<CR>', 'Pick buffer'},
|
||||
['<A-p>'] = {'<Cmd>BufferPin<CR>', 'Pin buffer'},
|
||||
['<A-d>'] = {'<Cmd>BufferClose<CR>', 'Delete buffer'},
|
||||
['<A-x>'] = {'<Cmd>BufferPickDelete<CR>', 'Delete picked buffer'},
|
||||
['<A-<>'] = {'<Cmd>BufferMovePrevious<CR>', 'Move buffer left'},
|
||||
['<A->>'] = {'<Cmd>BufferMoveNext<CR>', 'Move buffer right'},
|
||||
}
|
||||
require'which-key'.register {
|
||||
['<Leader>b'] = {
|
||||
name = 'Buffers',
|
||||
[','] = { '<Cmd>BufferPrevious<CR>', 'Next buffer'},
|
||||
['.'] = { '<Cmd>BufferNext<CR>', 'Previous buffer'},
|
||||
b = {'<Cmd>BufferPick<CR>', 'Pick buffer'},
|
||||
p = {'<Cmd>BufferPin<CR>', 'Pin buffer'},
|
||||
d = {'<Cmd>BufferClose<CR>', 'Delete buffer'},
|
||||
x = {'<Cmd>BufferPickDelete<CR>', 'Delete picked buffer'},
|
||||
h = {'<Cmd>BufferMovePrevious<CR>', 'Move buffer left'},
|
||||
l = {'<Cmd>BufferMoveNext<CR>', 'Move buffer right'},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
---- devicons ----
|
||||
require'nvim-web-devicons'.setup { default = true }
|
||||
|
||||
|
||||
---- editorconfig ----
|
||||
g.EditorConfig_exclude_patterns = {'fugitive://.*'}
|
||||
|
||||
|
||||
---- fidget ----
|
||||
require'fidget'.setup {}
|
||||
|
||||
|
@ -828,6 +871,8 @@ require'gitsigns'.setup {
|
|||
L = {gitsigns.toggle_current_line_blame, 'Toggle line blame'},
|
||||
b = {':Gitsigns change_base ', 'Change diff base'},
|
||||
B = {gitsigns.reset_base, 'Reset diff base'},
|
||||
p = {gitsigns.preview_hunk_inline, 'Preview hunk'},
|
||||
P = {gitsigns.preview_hunk, 'Preview hunk popup'},
|
||||
}
|
||||
}
|
||||
end
|
||||
|
@ -960,7 +1005,7 @@ au('LspAttach', {
|
|||
if not client then return end
|
||||
local function code_action()
|
||||
local ok, clear_action = pcall(require, 'clear-action')
|
||||
if ok then
|
||||
if ok and client.name ~= 'jdtls' then
|
||||
clear_action.code_action()
|
||||
else
|
||||
vim.lsp.buf.code_action()
|
||||
|
@ -1144,7 +1189,6 @@ g.rustfmt_emit_files = 1
|
|||
-- Use nigtly rustfmt for unstable settings
|
||||
g.rustfmt_command = 'rustup run nightly rustfmt'
|
||||
|
||||
-- use cargo-lints if available
|
||||
---- rust-tools ----
|
||||
require'rust-tools'.setup {
|
||||
tools = {
|
||||
|
@ -1186,6 +1230,9 @@ require'rust-tools'.setup {
|
|||
-- Enable proc macro support
|
||||
enable = true,
|
||||
},
|
||||
rustfmt = {
|
||||
extraArgs = { '+nightly' }
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1210,17 +1257,15 @@ g.startify_lists = {
|
|||
|
||||
|
||||
---- symbols-outline ----
|
||||
require'symbols-outline'.setup {
|
||||
-- Don't display preview automatically
|
||||
auto_preview = false,
|
||||
-- Don't highlight the hovered item
|
||||
highlight_hovered_item = true,
|
||||
-- Width should be in colums, not percent
|
||||
require'outline'.setup {
|
||||
outline_window = {
|
||||
-- Use absolute number of columns instead of percentage for sizing
|
||||
relative_width = false,
|
||||
-- width of the symbols window
|
||||
-- Window should be 30 columns wide
|
||||
width = 30,
|
||||
},
|
||||
}
|
||||
require'which-key'.register({['<Leader>o'] = {'<Cmd>SymbolsOutline<CR>', 'Symbols outline'}})
|
||||
require'which-key'.register({['<Leader>o'] = {'<Cmd>Outline<CR>', 'Symbols outline'}})
|
||||
|
||||
|
||||
---- tree ----
|
||||
|
@ -1246,6 +1291,8 @@ require('nvim-tree').setup {
|
|||
git = {
|
||||
-- Don't hide .gitignore'd files by default
|
||||
ignore = false,
|
||||
-- Extend timeout
|
||||
timeout = 5000,
|
||||
},
|
||||
-- Reload the tree when its window is focused
|
||||
reload_on_bufenter = true,
|
||||
|
|
Loading…
Reference in a new issue