Skip to content
2 changes: 1 addition & 1 deletion after/lsp/emmylua_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return {
workspace = {
library = {
'$VIMRUNTIME',
'$HOME/.local/share/nvim/lazy',
'$HOME/.local/share/nvim/site/pack/core/opt',
},
ignoreGlobs = { '**/*_spec.lua' },
},
Expand Down
63 changes: 19 additions & 44 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,55 +1,30 @@
vim.loader.enable()

_G.global = {}
_G.global.float_border_opts = { border = 'rounded', focusable = false, scope = 'line' }

vim.g.mapleader = ','
vim.g.maplocalleader = ','
vim.g.sessions_enabled = true

local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'--single-branch',
'https://github.com/folke/lazy.nvim.git',
lazypath,
})
-- Disable some builtin plugins (was handled by lazy.nvim's performance.rtp.disabled_plugins).
for _, plugin in ipairs({ 'gzip', 'tarPlugin', 'tohtml', 'zipPlugin', 'netrwPlugin', 'matchit', 'matchparen', 'tutor' }) do
vim.g['loaded_' .. plugin] = 1
end
vim.g.loaded_netrw = 1

-- Load every plugin spec from lua/plugin/, in alphabetical order.
local plugin_dir = vim.fs.joinpath(vim.fn.stdpath('config'), 'lua', 'plugin')
local plugin_files = {}
for name, type in vim.fs.dir(plugin_dir) do
if type == 'file' and name:match('%.lua$') then
plugin_files[#plugin_files + 1] = name:gsub('%.lua$', '')
end
end
table.sort(plugin_files)
for _, name in ipairs(plugin_files) do
require('plugin.' .. name)
end
vim.opt.runtimepath:prepend(lazypath)

require('lazy').setup({
performance = {
cache = {
enabled = true,
},
rtp = {
disabled_plugins = {
'gzip',
'tarPlugin',
'tohtml',
'zipPlugin',
'netrwPlugin',
'matchit',
'matchparen',
'tutor',
},
},
},
spec = {
{ import = 'plugins' },
},
defaults = {
lazy = true,
version = false,
},
install = {
missing = true,
colorscheme = { 'catppuccin' },
},
checker = { enabled = false },
rocks = { enabled = false },
})

vim.cmd.colorscheme('catppuccin-mocha')

Expand Down
3 changes: 1 addition & 2 deletions lua/config/autocommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})

vim.api.nvim_create_autocmd('User', {
pattern = 'VeryLazy',
vim.api.nvim_create_autocmd('VimEnter', {
callback = function()
if vim.fn.argc() > 0 or vim.env.NVIM_SKIP_SESSION then
return
Expand Down
6 changes: 4 additions & 2 deletions lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ u.map('n', '<leader>FF', '<cmd>!docker compose exec php php-cs-fixer fix %<cr>')
u.map('n', '<leader>gh', ':diffget //3<cr>')
u.map('n', '<leader>gu', ':diffget //2<cr>')

-- Lazy UI
u.map('n', '<leader>L', '<cmd>Lazy<cr>')
-- Plugins update (vim.pack)
u.map('n', '<leader>L', function()
vim.pack.update()
end)

--- Sessions
if vim.g.sessions_enabled then
Expand Down
147 changes: 0 additions & 147 deletions lua/config/textobjects_keymaps.lua

This file was deleted.

93 changes: 93 additions & 0 deletions lua/plugin/blink.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
--- @diagnostic disable: unresolved-require
local add = require('vim-pack').add

-- Auto-completion and snippets.
add({
{ src = 'saghen/blink.lib', setup = false },
{
src = 'saghen/blink.cmp',
opts = {
appearance = {
nerd_font_variant = 'mono',
},
completion = {
list = {
-- Insert items while navigating the completion list.
selection = { preselect = false, auto_insert = true },
max_items = 20,
},
documentation = { auto_show = true },
menu = {
scrollbar = false,
draw = {
columns = {
{ 'label', 'label_description', gap = 1 },
{ 'kind_icon' },
{ 'kind' },
{ 'source_name', gap = 1 },
},
},
},
},
keymap = {
['<Down>'] = { 'select_next', 'fallback' },
['<Up>'] = { 'select_prev', 'fallback' },
['<C-n>'] = { 'select_next', 'fallback_to_mappings' },
['<C-p>'] = { 'select_prev', 'fallback_to_mappings' },
['<C-y>'] = { 'select_and_accept', 'fallback' },
['<C-e>'] = { 'cancel', 'fallback' },

['<Tab>'] = { 'snippet_forward', 'select_next', 'fallback' },
['<S-Tab>'] = { 'snippet_backward', 'select_prev', 'fallback' },
['<CR>'] = { 'select_and_accept', 'fallback' },

['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },

['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },

['<C-k>'] = { 'show_signature', 'hide_signature', 'fallback' },
},
sources = {
default = { 'lsp', 'path', 'buffer', 'snippets' },
per_filetype = {
lua = { inherit_defaults = true, 'lazydev' },
sql = { 'dadbod', 'buffer' },
},
min_keyword_length = 0,
providers = {
snippets = {
max_items = 3,
},
lazydev = {
name = 'LazyDev',
module = 'lazydev.integrations.blink',
score_offset = 100,
},
dadbod = { name = 'Dadbod', module = 'vim_dadbod_completion.blink' },
buffer = {
-- default to all visible buffers
get_bufnrs = function()
return vim.iter(vim.api.nvim_list_wins())
:map(function(win)
return vim.api.nvim_win_get_buf(win)
end)
:filter(function(buf)
return vim.bo[buf].buftype ~= 'nofile'
end)
:totable()
end,
},
},
},
signature = { enabled = true },
fuzzy = {
implementation = 'prefer_rust',
},
},
on_setup = function()
-- TODO: Fix the Task type below.
require('blink.cmp').build():pwait(60000)
end,
},
})
22 changes: 22 additions & 0 deletions lua/plugin/blink_indent.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local add_on_event = require('vim-pack').add_on_event

-- Indent guides.
add_on_event('BufWinEnter', {
{
src = 'saghen/blink.indent',
opts = {
blocked = { buftypes = { include_defaults = true }, filetypes = { include_defaults = true } },
scope = {
char = '▏',
enabled = true,
indent_at_cursor = false,
priority = 1000,
underline = { enabled = true },
},
static = {
char = '▏',
enabled = true,
},
},
},
})
Loading
Loading