1
0

General changes + vim changes

This commit is contained in:
2024-10-10 21:17:54 +02:00
parent adc26f9860
commit 6790f75c8a
20 changed files with 273 additions and 138 deletions

View File

@@ -17,18 +17,16 @@ vim.opt.rtp:prepend(lazypath)
require('BluePlum.set')
require('BluePlum.keymap')
-- Lualine filename
local function hello()
return [[hello world]]
end
require('BluePlum.neovide')
require('BluePlum.utility')
require('lazy').setup({
-- Plugins
spec = {
{ import = 'plugins' },
},
checker = { enabled = true },
checker = { enabled = false },
change_detection = { notify = false },
})
require('lsp')

View File

@@ -1,29 +1,31 @@
{
"LuaSnip": { "branch": "master", "commit": "7552e6504ee95a9c8cfc6db53e389122ded46cd4" },
"LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
"actions-preview.nvim": { "branch": "master", "commit": "9f52a01c374318e91337697ebed51c6fae57f8a4" },
"baleia.nvim": { "branch": "main", "commit": "1b25eac3ac03659c3d3af75c7455e179e5f197f7" },
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" },
"compile-mode.nvim": { "branch": "main", "commit": "2bf8381871bf7a9dad347938ddef6b09a1735bdb" },
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
"formatter.nvim": { "branch": "fix-305-index-out-of-bounds", "commit": "a8a8b196c9ca37afa53f7ee30a98a343bbbca325" },
"gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" },
"inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "56db3d5ce5476b183783160e6045f7337ba12b83" },
"lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" },
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
"markview.nvim": { "branch": "main", "commit": "d0ccc97b5c988fb28e5033abdf7b832b9dfaf897" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "fd69d5c782a28420d51b648a3d7fe88df569d391" },
"lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" },
"lspkind.nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" },
"markview.nvim": { "branch": "main", "commit": "67b69cdaf9055bebac3682a070d7e5c8eecba29c" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"monokai-pro.nvim": { "branch": "master", "commit": "2bad2a92fe0ff6c8581d33a853a1b17592b83239" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-lspconfig": { "branch": "master", "commit": "e6528f4613c8db2e04be908eb2b5886d63f62a98" },
"nvim-treesitter": { "branch": "master", "commit": "d7353a6b72008b38aa873ace49aa97bea257941b" },
"nvim-ufo": { "branch": "main", "commit": "4cc3ba9303c0708b81fd681786a4835fd31518ac" },
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
"oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"promise-async": { "branch": "main", "commit": "038d05664fedc920ba86720214c84a15ff7432b0" },
"rustaceanvim": { "branch": "master", "commit": "7da155a907e3f48b1f7c25c59e248996fba833df" },
"telescope.nvim": { "branch": "master", "commit": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d" },
"todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }
"nvim-lspconfig": { "branch": "master", "commit": "ff69ecca55d83ffc70657f260a799f79a5637831" },
"nvim-treesitter": { "branch": "master", "commit": "9b1e607298dd5fc2ee6549488324cc92dafb99c0" },
"nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" },
"nvim-web-devicons": { "branch": "master", "commit": "56f17def81478e406e3a8ec4aa727558e79786f3" },
"oil.nvim": { "branch": "master", "commit": "ccab9d5e09e2d0042fbbe5b6bd05e82426247067" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"rustaceanvim": { "branch": "master", "commit": "d1f56672638508a7bc971cde31a29df4018579a9" },
"telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }
}

View File

@@ -25,3 +25,39 @@ vim.keymap.set('n', '<leader>l', ':e#<CR>')
vim.keymap.set('n', '<leader>i', 'cc')
-- peek
vim.keymap.set('n', '<leader>p', vim.lsp.buf.hover)
-- Scratch pad
vim.keymap.set(
'n',
'<leader>s',
':bo vs<CR>:enew<CR>:setlocal noswapfile<CR>:setlocal bufhidden=hide<CR>:setlocal buftype=nofile<CR>:set filetype=markdown<CR>:set syntax=markdown<CR>'
)
-- Help
vim.cmd.cnoreabbrev('h vert h')
-- Windows
vim.keymap.set('n', '<leader>k', function()
if vim.bo.modified then
if Confirm('Buffer has unsaved changes; write?') then
vim.cmd.write()
vim.cmd.bdelete()
else
vim.cmd('bd!')
end
else
vim.cmd.bdelete()
end
end)
-- Comp mode
vim.keymap.set('n', '<leader>s', function() -- s: start
local command = Input('Enter compilation command > ', vim.g.last_compile_command)
if command then
vim.g.last_compile_command = command
vim.cmd.Compile(command)
end
end)
vim.keymap.set('n', '<leader>E', ':NextError<CR>')
vim.keymap.set('n', '<leader>S', ':Recompile<CR>')

View File

@@ -0,0 +1,24 @@
if not vim.g.neovide then
return
end
vim.o.guifont = 'Jetbrains Mono:h17'
vim.g.neovide_underline_stroke_scale = 2.0
vim.g.neovide_theme = 'dark'
vim.g.neovide_refresh_rate_idle = 10
vim.g.neovide_transparency = 0.6
-- Scroll
vim.g.neovide_scroll_animation_length = 0.1
vim.g.neovide_scroll_animation_far_lines = 50
-- Cursor
vim.g.neovide_cursor_animation_length = 0.03
vim.g.neovide_cursor_trail_size = 0.5
vim.g.neovide_cursor_smooth_blink = true
vim.cmd.set('guicursor=i-v-c:blinkwait400-blinkoff350-blinkon250,i-ci-ve:ver25,r-cr:hor20,o:hor20')
-- Pasting
vim.keymap.set('i', '<SC-v>', '<C-r>+')
vim.keymap.set('n', '<SC-v>', '"+p')

View File

@@ -7,6 +7,8 @@ vim.opt.shiftwidth = 4
-- Line numbers
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.cursorlineopt = 'number'
-- Folding
vim.opt.foldlevelstart = 99
@@ -19,3 +21,20 @@ vim.g.terminal_emulator = 'kitty'
-- LSP
vim.lsp.inlay_hint.enable()
-- Splitting
-- vim.cmd.set('splitbelow')
-- vim.cmd.set('splitright')
vim.opt.splitright = true
vim.opt.splitbelow = true
-- Make text readable
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { '*.md', '*.typ' },
command = 'setlocal linebreak',
})
vim.api.nvim_create_autocmd('FileType', {
pattern = 'help',
command = 'setlocal linebreak',
})

View File

@@ -0,0 +1,53 @@
function Ask(msg)
vim.cmd.echohl('Question')
vim.cmd.echo('"' .. msg .. '"')
vim.cmd.echohl()
end
function Confirm(msg)
Ask(msg .. ' [Y/n] ')
local answer = vim.fn.getchar()
return answer ~= 110 and answer ~= 27 and answer ~= 37 -- 'n', <ESC>, <SPACE>
end
function Input(prompt, last)
local buffer = ''
while true do
vim.cmd('redraw | echo')
vim.api.nvim_echo({
{ prompt, 'Question' },
last and { last, 'Visual' } or { buffer, 'Normal' },
}, false, {})
local character = vim.fn.getchar()
if pcall(function(char)
if vim.fn.keytrans(char) ~= '<BS>' then
error()
end
end, character) then
last = nil
buffer = vim.fn.slice(buffer, 0, -1)
elseif character == 27 then
vim.cmd('redraw | echo')
return nil
elseif character == 13 then
return last or buffer
elseif
(character == 32 or pcall(function(char)
if vim.fn.keytrans(char) ~= '<Right>' then
error()
end
end, character)) and last
then
buffer = last
if character == 32 then
buffer = buffer .. ' '
end
last = nil
else
last = nil
buffer = buffer .. vim.fn.nr2char(character)
end
end
end

View File

@@ -114,31 +114,13 @@ cmp.setup({
return kind
end,
-- format = function(entry, vim_item)
-- -- Kind icons
-- vim_item.kind = string.format('%s %s ', cmp_kind_icons[vim_item.kind], vim_item.kind)
--
-- return vim_item
-- end,
-- format = function(entry, item)
-- local menu_icon = {
-- nvim_lsp = 'λ',
-- luasnip = '⋗',
-- buffer = 'Ω',
-- path = '🖫',
-- }
-- item.menu = menu_icon[entry.source.name]
-- return item
-- end
},
})
-- #region Highlight groups
-- Customization for Pmenu
vim.api.nvim_set_hl(0, 'PmenuSel', { bg = '#282C34', fg = 'NONE' })
vim.api.nvim_set_hl(0, 'Pmenu', { fg = '#C5CDD9', bg = '#22252A' })
@@ -151,9 +133,9 @@ vim.api.nvim_set_hl(0, 'CmpItemKindField', { fg = '#EED8DA', bg = '#B5585F' })
vim.api.nvim_set_hl(0, 'CmpItemKindProperty', { fg = '#EED8DA', bg = '#B5585F' })
vim.api.nvim_set_hl(0, 'CmpItemKindEvent', { fg = '#EED8DA', bg = '#B5585F' })
vim.api.nvim_set_hl(0, 'CmpItemKindText', { fg = '#e2f3c9', bg = '#94c549' })
vim.api.nvim_set_hl(0, 'CmpItemKindEnum', { fg = '#e2f3c9', bg = '#94c549' })
vim.api.nvim_set_hl(0, 'CmpItemKindKeyword', { fg = '#e2f3c9', bg = '#94c549' })
vim.api.nvim_set_hl(0, 'CmpItemKindText', { fg = '#C3E88D', bg = '#9FBD73' })
vim.api.nvim_set_hl(0, 'CmpItemKindEnum', { fg = '#C3E88D', bg = '#9FBD73' })
vim.api.nvim_set_hl(0, 'CmpItemKindKeyword', { fg = '#C3E88D', bg = '#9FBD73' })
vim.api.nvim_set_hl(0, 'CmpItemKindConstant', { fg = '#FFE082', bg = '#D4BB6C' })
vim.api.nvim_set_hl(0, 'CmpItemKindConstructor', { fg = '#FFE082', bg = '#D4BB6C' })
@@ -168,9 +150,9 @@ vim.api.nvim_set_hl(0, 'CmpItemKindOperator', { fg = '#EADFF0', bg = '#A377BF' }
vim.api.nvim_set_hl(0, 'CmpItemKindVariable', { fg = '#C5CDD9', bg = '#7E8294' })
vim.api.nvim_set_hl(0, 'CmpItemKindFile', { fg = '#C5CDD9', bg = '#7E8294' })
vim.api.nvim_set_hl(0, 'CmpItemKindUnit', { fg = '#F5EBD9', bg = '#D29a32' })
vim.api.nvim_set_hl(0, 'CmpItemKindSnippet', { fg = '#F5EBD9', bg = '#D29a32' })
vim.api.nvim_set_hl(0, 'CmpItemKindFolder', { fg = '#F5EBD9', bg = '#D29a32' })
vim.api.nvim_set_hl(0, 'CmpItemKindUnit', { fg = '#F5EBD9', bg = '#D4A959' })
vim.api.nvim_set_hl(0, 'CmpItemKindSnippet', { fg = '#F5EBD9', bg = '#D4A959' })
vim.api.nvim_set_hl(0, 'CmpItemKindFolder', { fg = '#F5EBD9', bg = '#D4A959' })
vim.api.nvim_set_hl(0, 'CmpItemKindMethod', { fg = '#DDE5F5', bg = '#6C8ED4' })
vim.api.nvim_set_hl(0, 'CmpItemKindValue', { fg = '#DDE5F5', bg = '#6C8ED4' })

View File

@@ -0,0 +1,23 @@
return {
{
'ej-shafran/compile-mode.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'm00qek/baleia.nvim',
},
config = function()
vim.api.nvim_set_hl(0, 'CompileModeInfo', { link = 'DiagnosticInfo' })
vim.api.nvim_set_hl(0, 'CompileModeWarning', { link = 'DiagnosticWarning' })
vim.api.nvim_set_hl(0, 'CompileModeError', { link = 'DiagnosticError' })
vim.api.nvim_set_hl(0, 'CompileModeCommandOutput', { link = 'Statement' })
vim.api.nvim_set_hl(0, 'CompileModeMessage', { link = 'SpellCap' })
vim.api.nvim_set_hl(0, 'CompileModeMessageRow', { link = 'CursorLineNr' })
vim.api.nvim_set_hl(0, 'CompileModeMessageCol', { link = 'CursorLineNr' })
vim.g.compile_mode = {
baleria_setup = true,
}
end,
},
}

View File

@@ -1,13 +1,10 @@
return {
{
'loctvl842/monokai-pro.nvim',
-- lazy = true,
'blazkowolf/gruber-darker.nvim',
priority = 999,
config = function()
require('monokai-pro').setup({
filter = 'spectrum',
})
vim.cmd.colorscheme('monokai-pro')
-- require('gruber-darker').setup()
vim.cmd.colorscheme('gruber-darker')
end,
},
}