Merge pull request 'master' (#2) from PlexSheep/configs:master into master

Reviewed-on: cscherrNT/configs#2
This commit is contained in:
cscherrNT 2023-07-17 12:11:46 +02:00
commit 3baeb502a3
3 changed files with 33 additions and 7 deletions

View File

@ -1,8 +1,8 @@
# configs
This repository contains most of the configs I use on my systems, this is all for Linux
systems, be it servers or workstations. To install it, just run the desktop/server script as the
target user, some stuff will need to run as root.
This repository contains most of the configs I use on my systems, this is all
for Linux systems, be it servers or workstations. To install it, just run the
desktop/server script as the target user, some stuff will need to run as root.
# Dependencies
- vim
@ -14,9 +14,10 @@ target user, some stuff will need to run as root.
- lsd (workstations)
- nodejs (nvim language server)
# Mirrored
The origin of this repository is [git.cscherr.de](https://git.cscherr.de/PlexSheep/configs.git)
It is mirrored to:
- [github](https://github.com/PlexSheep/configs)
- [codeberg](https://codeberg.org/PlexSheep/configs)
- [GitHub](https://github.com/PlexSheep/configs)
- [Codeberg](https://codeberg.org/PlexSheep/configs)

View File

@ -10,6 +10,31 @@ inoremap <silent><expr> <cr> coc#pum#visible() ? coc#pum#confirm() :
lua << EOF
require("nvim-autopairs").setup {}
local Rule = require('nvim-autopairs.rule')
local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')
npairs.add_rule(Rule("<>","<>","rs"))
npairs.setup({map_cr=false})
-- skip it, if you use another global object
_G.MUtils= {}
-- old version
-- MUtils.completion_confirm=function()
-- if vim.fn["coc#pum#visible"]() ~= 0 then
-- return vim.fn["coc#_select_confirm"]()
-- else
-- return npairs.autopairs_cr()
-- end
-- end
-- new version for custom pum
MUtils.completion_confirm=function()
if vim.fn["coc#pum#visible"]() ~= 0 then
return vim.fn["coc#pum#confirm"]()
else
return npairs.autopairs_cr()
end
end
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
EOF

View File

@ -21,7 +21,7 @@ local function my_on_attach(bufnr)
-- however, through magic, the default keys are loaded anyways ONLY IN WSL
-- I have made a separate branch (wsl) for any such things
-- just use a proper Linux, if possible
--api.config.mappings.default_on_attach(bufnr)
api.config.mappings.default_on_attach(bufnr)
-- custom mappings
-- cd