look and md

This commit is contained in:
Julius Waldmann 2024-08-01 18:42:52 +02:00
parent 7ceef4b600
commit 87d465d5d5
5 changed files with 232 additions and 54 deletions

180
after/plugin/barbar.lua Normal file
View File

@ -0,0 +1,180 @@
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
-- Goto buffer in position...
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
-- Pin/unpin buffer
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
-- Close buffer
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
-- Wipeout buffer
-- :BufferWipeout
-- Close commands
-- :BufferCloseAllButCurrent
-- :BufferCloseAllButPinned
-- :BufferCloseAllButCurrentOrPinned
-- :BufferCloseBuffersLeft
-- :BufferCloseBuffersRight
-- Magic buffer-picking mode
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
-- Sort automatically by...
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
map('n', '<Space>bn', '<Cmd>BufferOrderByName<CR>', opts)
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
-- Other:
-- :BarbarEnable - enables barbar (enabled by default)
-- :BarbarDisable - very bad command, should never be used
require'barbar'.setup {
-- WARN: do not copy everything below into your config!
-- It is just an example of what configuration options there are.
-- The defaults are suitable for most people.
-- Enable/disable animations
animation = true,
-- Automatically hide the tabline when there are this many buffers left.
-- Set to any value >=0 to enable.
auto_hide = false,
-- Enable/disable current/total tabpages indicator (top right corner)
tabpages = true,
-- Enables/disable clickable tabs
-- - left-click: go to buffer
-- - middle-click: delete buffer
clickable = true,
-- Excludes buffers from the tabline
exclude_ft = {'javascript'},
exclude_name = {'package.json'},
-- A buffer to this direction will be focused (if it exists) when closing the current buffer.
-- Valid options are 'left' (the default), 'previous', and 'right'
focus_on_close = 'left',
-- Hide inactive buffers and file extensions. Other options are `alternate`, `current`, and `visible`.
--hide = {extensions = true, inactive = true},
-- Disable highlighting alternate buffers
highlight_alternate = false,
-- Disable highlighting file icons in inactive buffers
highlight_inactive_file_icons = false,
-- Enable highlighting visible buffers
highlight_visible = true,
icons = {
-- Configure the base icons on the bufferline.
-- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript'
buffer_index = true,
buffer_number = false,
button = '',
-- Enables / disables diagnostic symbols
diagnostics = {
[vim.diagnostic.severity.ERROR] = {enabled = true, icon = ''},
[vim.diagnostic.severity.WARN] = {enabled = false},
[vim.diagnostic.severity.INFO] = {enabled = false},
[vim.diagnostic.severity.HINT] = {enabled = true},
},
gitsigns = {
added = {enabled = true, icon = '+'},
changed = {enabled = true, icon = '~'},
deleted = {enabled = true, icon = '-'},
},
filetype = {
-- Sets the icon's highlight group.
-- If false, will use nvim-web-devicons colors
custom_colors = false,
-- Requires `nvim-web-devicons` if `true`
enabled = true,
},
separator = {left = '', right = ''},
-- If true, add an additional separator at the end of the buffer list
separator_at_end = true,
-- Configure the icons on the bufferline when modified or pinned.
-- Supports all the base icon options.
modified = {button = ''},
pinned = {button = '', filename = true},
-- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted'
preset = 'default',
-- Configure the icons on the bufferline based on the visibility of a buffer.
-- Supports all the base icon options, plus `modified` and `pinned`.
alternate = {filetype = {enabled = false}},
current = {buffer_index = true},
inactive = {button = '×'},
visible = {modified = {buffer_number = false}},
},
-- If true, new buffers will be inserted at the start/end of the list.
-- Default is to insert after current buffer.
insert_at_end = false,
insert_at_start = false,
-- Sets the maximum padding width with which to surround each tab
maximum_padding = 1,
-- Sets the minimum padding width with which to surround each tab
minimum_padding = 1,
-- Sets the maximum buffer name length.
maximum_length = 30,
-- Sets the minimum buffer name length.
minimum_length = 0,
-- If set, the letters for each buffer in buffer-pick mode will be
-- assigned based on their name. Otherwise or in case all letters are
-- already assigned, the behavior is to assign letters in order of
-- usability (see order below)
semantic_letters = true,
-- Set the filetypes which barbar will offset itself for
sidebar_filetypes = {
-- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'}
NvimTree = true,
-- Or, specify the text used for the offset:
undotree = {
text = 'undotree',
align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
},
-- Or, specify the event which the sidebar executes when leaving:
['neo-tree'] = {event = 'BufWipeout'},
-- Or, specify all three
Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'},
},
-- New buffer letters are assigned in this order. This order is
-- optimal for the qwerty keyboard layout but might need adjustment
-- for other layouts.
letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',
-- Sets the name of unnamed buffers. By default format is "[Buffer X]"
-- where X is the buffer number. But only a static string is accepted here.
no_name_title = nil,
}

View File

@ -1,54 +0,0 @@
function LineNumberColors()
vim.api.nvim_set_hl(0, 'LineNrAbove', { fg='#51B3EC', bold=true })
vim.api.nvim_set_hl(0, 'LineNr', { fg='white', bold=true })
vim.api.nvim_set_hl(0, 'LineNrBelow', { fg='#FB508F', bold=true })
vim.o.signcolumn = "auto"
vim.o.numberwidth = 1
end
--local function set_terminal_mode_statuscolumn()
-- vim.wo.relativenumber = true
-- vim.wo.number = true
-- vim.wo.statuscolumn = [[%=%{&number ? (v:relnum == 0 ? '~' : printf('%1d', v:relnum)) : ''}]]
--end
--
---- Function to reset status column back to default
--local function reset_normal_mode_statuscolumn()
-- vim.wo.relativenumber = true
-- vim.wo.number = true
-- --vim.wo.statuscolumn = [[%=%{v:relnum ? printf('%1d', v:relnum) : printf('%1d', v:lnum)}]]
-- --vim.wo.statuscolumn = [[%=%{&number ? (v:relnum == 0 ? printf('%1d', v:lnum) : printf('%1d', v:relnum)) : ''}]]
-- vim.wo.statuscolumn = [[%=%{printf('1%d', v:relnum)}]]
--end
--
--vim.api.nvim_create_augroup('TerminalModeStatusColumn', { clear = true })
--
--vim.api.nvim_create_autocmd('TermEnter', {
-- group = 'TerminalModeStatusColumn',
-- pattern = '*',
-- callback = function()
-- LineNumberColors()
-- set_terminal_mode_statuscolumn()
-- end
--})
--
--vim.api.nvim_create_autocmd('TermLeave', {
-- group = 'TerminalModeStatusColumn',
-- pattern = '*',
-- callback = function()
-- LineNumberColors()
-- reset_normal_mode_statuscolumn()
-- end
--})
--
--vim.api.nvim_create_autocmd('CursorMoved', {
-- group = 'TerminalModeStatusColumn',
-- pattern = '*',
-- callback = function()
-- if vim.bo.buftype == 'terminal' then
-- set_terminal_mode_statuscolumn()
-- end
-- end,
--})
--LineNumberColors()

View File

@ -37,6 +37,15 @@ cmp.setup({
{name = 'nvim_lua'}, {name = 'nvim_lua'},
{name = 'luasnip', keyword_length = 2}, {name = 'luasnip', keyword_length = 2},
{name = 'buffer', keyword_length = 3}, {name = 'buffer', keyword_length = 3},
{
name = 'look',
keyword_length = 2,
option = {
convert_case = true,
loud = true
--dict = '/usr/share/dict/words'
}
},
}, },
formatting = lsp_zero.cmp_format(), formatting = lsp_zero.cmp_format(),
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({

View File

@ -1,14 +1,19 @@
{ {
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
"barbar.nvim": { "branch": "master", "commit": "79f7d16578a167bdf5355725551ef7d90613a601" },
"cmp-look": { "branch": "master", "commit": "971e65a6be0e75c3438fe7b176d4fc020cb89d7b" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"conform.nvim": { "branch": "master", "commit": "6dc1603ea408f476a57937bbeaf7f86520a21a98" }, "conform.nvim": { "branch": "master", "commit": "6dc1603ea408f476a57937bbeaf7f86520a21a98" },
"cutlass.nvim": { "branch": "main", "commit": "1ac7e4b53d79410be52a9e464d44c60556282b3e" }, "cutlass.nvim": { "branch": "main", "commit": "1ac7e4b53d79410be52a9e464d44c60556282b3e" },
"flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" },
"fzf-lua": { "branch": "main", "commit": "9c953dfa7650191d892800333d187f3439e01afd" }, "fzf-lua": { "branch": "main", "commit": "9c953dfa7650191d892800333d187f3439e01afd" },
"gitsigns.nvim": { "branch": "main", "commit": "bcae8395fb1033ed0340dd00d61b3bf050b1bd8e" },
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
"instant.nvim": { "branch": "master", "commit": "294b6d08143b3db8f9db7f606829270149e1a786" }, "instant.nvim": { "branch": "master", "commit": "294b6d08143b3db8f9db7f606829270149e1a786" },
"lazy.nvim": { "branch": "main", "commit": "d3974346b6cef2116c8e7b08423256a834cb7cbc" }, "lazy.nvim": { "branch": "main", "commit": "d3974346b6cef2116c8e7b08423256a834cb7cbc" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "d1114ca5ff28ffcd0bc2a3fdd4c13019b1c41812" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "d1114ca5ff28ffcd0bc2a3fdd4c13019b1c41812" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"neovim": { "branch": "main", "commit": "17b466e79479758b332a3cac12544a3ad2be6241" }, "neovim": { "branch": "main", "commit": "17b466e79479758b332a3cac12544a3ad2be6241" },

View File

@ -59,6 +59,7 @@ return lazy.setup({
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
'octaltree/cmp-look',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip' 'L3MON4D3/LuaSnip'
}, },
@ -139,6 +140,43 @@ return lazy.setup({
wilder.setup({modes = {':', '/', '?'}}) wilder.setup({modes = {':', '/', '?'}})
end, end,
}, },
{
"willothy/flatten.nvim",
config = true,
-- or pass configuration with
-- opts = { }
-- Ensure that it runs first to minimize delay when opening file from terminal
lazy = false,
priority = 1001,
},
{'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- animation = true,
-- insert_at_start = true,
-- …etc.
},
version = '^1.0.0', -- optional: only update when a new 1.x version is released
},
{
dir = "~/Documents/code/here.nvim",
name = "here",
config = function ()
require("here")
end
},
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end,
}
-- Uncomment these lines if you want to use the plugins -- Uncomment these lines if you want to use the plugins
-- use 'nvim-tree/nvim-tree.lua' -- use 'nvim-tree/nvim-tree.lua'
-- use 'nvim-tree/nvim-web-devicons' -- use 'nvim-tree/nvim-web-devicons'