Merge branch 'dev' into logos

scripts: improve dmenuopen spped
         fix error codes
nvim: static colors for Coq
      new plugin: autopairs
      update lua_lsp config
      fix verilog maps
      add c and lua filetype settings
      change packersync map
npm: add config
This commit is contained in:
David JULIEN 2021-10-30 16:14:47 +02:00
commit fcb9619dd6
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
12 changed files with 53 additions and 23 deletions

4
.config/npm/npmrc Normal file
View File

@ -0,0 +1,4 @@
prefix=${XDG_DATA_HOME}/npm
cache=${XDG_CACHE_HOME}/npm
tmp=${XDG_RUNTIME_DIR}/npm
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js

View File

@ -0,0 +1,9 @@
-- Author : swytch
-- Created : Saturday Oct. 30, 2021 11:43:34 CET
-- License : GPLv3
-- Description : c settings file
local opt = vim.opt
local g = vim.g
opt.formatoptions = "trq1jp"

View File

@ -0,0 +1,9 @@
-- Author : swytch
-- Created : Saturday Oct. 30, 2021 11:43:21 CET
-- License : GPLv3
-- Description : lua settings file
local opt = vim.opt
local g = vim.g
opt.formatoptions = "trq1jp"

View File

@ -7,7 +7,8 @@ utils.map("n", "<C-c>", "<cmd>CoqInterrupt<CR>")
utils.map("n", "<leader>j", "<cmd>CoqNext<CR>")
utils.map("n", "<leader>k", "<cmd>CoqUndo<CR>")
utils.map("n", "<leader><CR>", "<cmd>CoqToLine<CR>")
utils.map("n", "<leader>a", "<cmd>Coq About")
utils.map("n", "<leader>G", "<cmd>CoqJumpToEnd")
utils.map("n", "<leader>a", ":Coq About")
utils.map("n", "<leader>s", ":Coq Search")
utils.map("n", "<leader>G", "<cmd>CoqJumpToEnd<CR>")
utils.map("i", "//", "")

View File

@ -11,6 +11,10 @@ local sumneko_root_path = vim.fn.stdpath("data") ..
local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name ..
"/lua-language-server"
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
settings = {
@ -19,7 +23,7 @@ require'lspconfig'.sumneko_lua.setup {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = vim.split(package.path, ';'),
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
@ -27,10 +31,7 @@ require'lspconfig'.sumneko_lua.setup {
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
},
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {

View File

@ -7,7 +7,7 @@ utils.map("n", "<space>", "<leader>")
utils.map("n", "<leader>y", "\"+y")
utils.map("n", "<leader>p", "\"+P")
utils.map("n", "<leader><enter>", "<cmd>w! | !compiler %<CR>")
utils.map("n", "<leader>s", "<cmd>PackerSync<CR>")
utils.map("n", "<leader>u", "<cmd>PackerSync<CR>")
utils.map("n", "<leader>c", "<cmd>ColorizerToggle<CR>")
-- LSP

View File

@ -5,6 +5,7 @@
local cmp = require("cmp")
local luasnip = require("luasnip")
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
@ -17,6 +18,9 @@ local check_backspace = function()
sub(col, col):match('%s') == nil
end
-- If you want insert `(` after select function or method item
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
cmp.setup {
completion = {
autocomplete = false

View File

@ -86,6 +86,12 @@ return require("packer").startup(function()
config = function() require("plugin.comment") end
}
-- autopairs
use {
"windwp/nvim-autopairs",
config = function() require('nvim-autopairs').setup() end
}
-- display colors directly in editor
use {
"norcalli/nvim-colorizer.lua",

View File

@ -21,6 +21,7 @@ export TEXMFHOME="$XDG_DATA_HOME/texmf"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export OPAMROOT="$XDG_DATA_HOME/opam"
export COQBIN="$OPAMROOT/default/bin/"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
## default programs
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"

View File

@ -10,22 +10,19 @@
######################################################################
filetypes=".pdf .png .jpg .txt .mom .tex .mkv" # could be augmented
filetypes="pdf png jpg txt mom tex mkv" # could be augmented
filetype=$(printf "$filetypes" | sed "s| |\n|g" | dmenu -i -p "type of the file?")
if [ -z "$filetype" ]; then
exit 0
fi
[ -z "$filetype" ] && exit 1
file=$(find $HOME/ -type f | grep "$filetype" | dmenu -i -l 20 -p "open")
if [ -z "$file" ]; then
exit 0
fi
file=$(find $HOME/{documents,downloads} -type f -path "*.$filetype" | dmenu -i -l 20 -p "open")
[ -z "$file" ] && exit 2
case "$filetype" in
*.pdf) zathura "$file" ;;
*.png|.jpg) sxiv "$file" ;;
*.txt|*.mom|*.tex) "$TERMINAL" -e nvim "$file" ;;
*.mkv) mpv "$file";;
pdf) zathura "$file" ;;
png|jpg) sxiv "$file" ;;
txt|mom|tex) "$TERMINAL" -e nvim "$file" ;;
mkv) mpv "$file";;
esac

View File

@ -46,5 +46,3 @@ else
switch_scheme
fi
fi
exit 0

@ -1 +1 @@
Subproject commit c329ff44d3aef42e8347563bf7ae119b5a2a2d70
Subproject commit d77e1cfe127418ab00c6d5fb076f89cdf9b49e94