Compare commits

...

3 Commits

Author SHA1 Message Date
andrzej 94602ebb32 fix syntax
it doesn't always fire correctly, so hopefully this fixes it
2024-05-03 20:02:13 +02:00
andrzej 3219964cb3 remove modes groups (plugin uninstalled) 2024-05-03 20:01:50 +02:00
andrzej 939e4ae8e8 style cmp window 2024-05-03 20:01:31 +02:00
3 changed files with 43 additions and 13 deletions

View File

@ -37,9 +37,11 @@ return { -- Autocompletion
-- into multiple repos for maintenance purposes. -- into multiple repos for maintenance purposes.
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"onsails/lspkind.nvim",
}, },
config = function() config = function()
-- See `:help cmp` -- See `:help cmp`
local lspkind = require("lspkind")
local cmp = require("cmp") local cmp = require("cmp")
local luasnip = require("luasnip") local luasnip = require("luasnip")
luasnip.config.setup({}) luasnip.config.setup({})
@ -115,6 +117,40 @@ return { -- Autocompletion
{ name = "luasnip" }, { name = "luasnip" },
{ name = "path" }, { name = "path" },
}, },
formatting = {
fields = { "kind", "abbr", "menu" },
expandable_indicator = true,
format = lspkind.cmp_format({
mode = "symbol_text", -- show only symbol annotations
menu = {
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
nvim_lua = "[Lua]",
latex_symbols = "[Latex]",
},
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- can also be a function to dynamically calculate max width such as
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
before = function(entry, vim_item)
return vim_item
end,
}),
},
window = {
completion = cmp.config.window.bordered({
col_offset = -3,
side_padding = 1,
}),
documentation = cmp.config.window.bordered({
winhighlight = "Normal:CursorLine",
}),
},
}) })
end, end,
} }

View File

@ -58,12 +58,6 @@ return {
-- VertSplit = { fg = "muted", bg = "muted" }, -- VertSplit = { fg = "muted", bg = "muted" },
Folded = { fg = "foam", bg = "highlight_med" }, Folded = { fg = "foam", bg = "highlight_med" },
CursorLine = { bg = "surface" }, CursorLine = { bg = "surface" },
ModesInsert = { bg = "gold" },
--cursor line
ModesInsertCursorLine = { bg = "overlay" },
ModesVisual = { bg = "foam" },
ModesVisualVisual = { bg = "pine" },
}, },
before_highlight = function(group, highlight, palette) before_highlight = function(group, highlight, palette)

View File

@ -1,7 +1,7 @@
#! /bin/bash #! /bin/bash
bgsDirectory="${HOME}/bgs/" bgsDirectory="${HOME}/bgs/"
slideshow() { slideshow() {
gsettings set org.cinnamon.desktop.background.slideshow slideshow-enabled ${1} gsettings set org.cinnamon.desktop.background.slideshow slideshow-enabled "${1}"
} }
setDirectory() { setDirectory() {
gsettings set org.cinnamon.desktop.background.slideshow image-source "directory:///${bgsDirectory}${1}" gsettings set org.cinnamon.desktop.background.slideshow image-source "directory:///${bgsDirectory}${1}"
@ -22,7 +22,7 @@ slideshowEnabled=$(gsettings get org.cinnamon.desktop.background.slideshow slide
chooseRandom(){ chooseRandom(){
shopt -s nullglob shopt -s nullglob
files=(${1}*) files=("${1}"*)
length=$((${#files[@]})) length=$((${#files[@]}))
echo "length: ${length}" echo "length: ${length}"
randomIndex=$(($RANDOM % $length)) randomIndex=$(($RANDOM % $length))
@ -30,23 +30,23 @@ chooseRandom(){
setImage "${files[$randomIndex]}" setImage "${files[$randomIndex]}"
} }
slideshowOrRandom(){ slideshowOrRandom(){
if [ "$#" -gt 1 -a "$2" = r ]; then if [ "$#" -gt 1 ]&&[ "$2" = r ]; then
slideshow false slideshow false
chooseRandom "${bgsDirectory}${1}" chooseRandom "${bgsDirectory}${1}"
else else
slideshow true slideshow true
setDirectory ${1} setDirectory "${1}"
fi fi
} }
case $1 in case $1 in
c) c)
slideshowOrRandom "chsck/" $2 slideshowOrRandom "chsck/" "$2"
;; ;;
l) l)
slideshowOrRandom "leics/" $2 slideshowOrRandom "leics/" "$2"
;; ;;
a) a)
slideshowOrRandom "art/" $2 slideshowOrRandom "art/" "$2"
;; ;;
t) toggle t) toggle
;; ;;