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:
commit
fcb9619dd6
4
.config/npm/npmrc
Normal file
4
.config/npm/npmrc
Normal 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
|
9
.config/nvim/after/ftplugin/c.lua
Normal file
9
.config/nvim/after/ftplugin/c.lua
Normal 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"
|
9
.config/nvim/after/ftplugin/lua.lua
Normal file
9
.config/nvim/after/ftplugin/lua.lua
Normal 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"
|
@ -7,7 +7,8 @@ utils.map("n", "<C-c>", "<cmd>CoqInterrupt<CR>")
|
|||||||
utils.map("n", "<leader>j", "<cmd>CoqNext<CR>")
|
utils.map("n", "<leader>j", "<cmd>CoqNext<CR>")
|
||||||
utils.map("n", "<leader>k", "<cmd>CoqUndo<CR>")
|
utils.map("n", "<leader>k", "<cmd>CoqUndo<CR>")
|
||||||
utils.map("n", "<leader><CR>", "<cmd>CoqToLine<CR>")
|
utils.map("n", "<leader><CR>", "<cmd>CoqToLine<CR>")
|
||||||
utils.map("n", "<leader>a", "<cmd>Coq About")
|
utils.map("n", "<leader>a", ":Coq About")
|
||||||
utils.map("n", "<leader>G", "<cmd>CoqJumpToEnd")
|
utils.map("n", "<leader>s", ":Coq Search")
|
||||||
|
utils.map("n", "<leader>G", "<cmd>CoqJumpToEnd<CR>")
|
||||||
|
|
||||||
utils.map("i", "//", "∥")
|
utils.map("i", "//", "∥")
|
||||||
|
@ -11,6 +11,10 @@ local sumneko_root_path = vim.fn.stdpath("data") ..
|
|||||||
local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name ..
|
local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name ..
|
||||||
"/lua-language-server"
|
"/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 {
|
require'lspconfig'.sumneko_lua.setup {
|
||||||
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
|
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
|
||||||
settings = {
|
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)
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
version = 'LuaJIT',
|
version = 'LuaJIT',
|
||||||
-- Setup your lua path
|
-- Setup your lua path
|
||||||
path = vim.split(package.path, ';'),
|
path = runtime_path,
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
-- Get the language server to recognize the `vim` global
|
-- Get the language server to recognize the `vim` global
|
||||||
@ -27,10 +31,7 @@ require'lspconfig'.sumneko_lua.setup {
|
|||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
-- Make the server aware of Neovim runtime files
|
-- Make the server aware of Neovim runtime files
|
||||||
library = {
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
|
||||||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
telemetry = {
|
telemetry = {
|
||||||
|
@ -7,7 +7,7 @@ utils.map("n", "<space>", "<leader>")
|
|||||||
utils.map("n", "<leader>y", "\"+y")
|
utils.map("n", "<leader>y", "\"+y")
|
||||||
utils.map("n", "<leader>p", "\"+P")
|
utils.map("n", "<leader>p", "\"+P")
|
||||||
utils.map("n", "<leader><enter>", "<cmd>w! | !compiler %<CR>")
|
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>")
|
utils.map("n", "<leader>c", "<cmd>ColorizerToggle<CR>")
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
|
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||||
|
|
||||||
local t = function(str)
|
local t = function(str)
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
@ -17,6 +18,9 @@ local check_backspace = function()
|
|||||||
sub(col, col):match('%s') == nil
|
sub(col, col):match('%s') == nil
|
||||||
end
|
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 {
|
cmp.setup {
|
||||||
completion = {
|
completion = {
|
||||||
autocomplete = false
|
autocomplete = false
|
||||||
|
@ -86,6 +86,12 @@ return require("packer").startup(function()
|
|||||||
config = function() require("plugin.comment") end
|
config = function() require("plugin.comment") end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- autopairs
|
||||||
|
use {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function() require('nvim-autopairs').setup() end
|
||||||
|
}
|
||||||
|
|
||||||
-- display colors directly in editor
|
-- display colors directly in editor
|
||||||
use {
|
use {
|
||||||
"norcalli/nvim-colorizer.lua",
|
"norcalli/nvim-colorizer.lua",
|
||||||
|
@ -21,6 +21,7 @@ export TEXMFHOME="$XDG_DATA_HOME/texmf"
|
|||||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||||
export OPAMROOT="$XDG_DATA_HOME/opam"
|
export OPAMROOT="$XDG_DATA_HOME/opam"
|
||||||
export COQBIN="$OPAMROOT/default/bin/"
|
export COQBIN="$OPAMROOT/default/bin/"
|
||||||
|
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
||||||
|
|
||||||
## default programs
|
## default programs
|
||||||
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
|
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
|
||||||
|
@ -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?")
|
filetype=$(printf "$filetypes" | sed "s| |\n|g" | dmenu -i -p "type of the file?")
|
||||||
|
|
||||||
if [ -z "$filetype" ]; then
|
[ -z "$filetype" ] && exit 1
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
file=$(find $HOME/ -type f | grep "$filetype" | dmenu -i -l 20 -p "open")
|
|
||||||
|
|
||||||
if [ -z "$file" ]; then
|
file=$(find $HOME/{documents,downloads} -type f -path "*.$filetype" | dmenu -i -l 20 -p "open")
|
||||||
exit 0
|
|
||||||
fi
|
[ -z "$file" ] && exit 2
|
||||||
|
|
||||||
case "$filetype" in
|
case "$filetype" in
|
||||||
*.pdf) zathura "$file" ;;
|
pdf) zathura "$file" ;;
|
||||||
*.png|.jpg) sxiv "$file" ;;
|
png|jpg) sxiv "$file" ;;
|
||||||
*.txt|*.mom|*.tex) "$TERMINAL" -e nvim "$file" ;;
|
txt|mom|tex) "$TERMINAL" -e nvim "$file" ;;
|
||||||
*.mkv) mpv "$file";;
|
mkv) mpv "$file";;
|
||||||
esac
|
esac
|
||||||
|
@ -46,5 +46,3 @@ else
|
|||||||
switch_scheme
|
switch_scheme
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit c329ff44d3aef42e8347563bf7ae119b5a2a2d70
|
Subproject commit d77e1cfe127418ab00c6d5fb076f89cdf9b49e94
|
Reference in New Issue
Block a user