diff --git a/.config/npm/npmrc b/.config/npm/npmrc new file mode 100644 index 0000000..fc84b78 --- /dev/null +++ b/.config/npm/npmrc @@ -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 diff --git a/.config/nvim/after/ftplugin/c.lua b/.config/nvim/after/ftplugin/c.lua new file mode 100644 index 0000000..6dfd3f6 --- /dev/null +++ b/.config/nvim/after/ftplugin/c.lua @@ -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" diff --git a/.config/nvim/after/ftplugin/lua.lua b/.config/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..698ac52 --- /dev/null +++ b/.config/nvim/after/ftplugin/lua.lua @@ -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" diff --git a/.config/nvim/after/ftplugin/verilog.lua b/.config/nvim/after/ftplugin/verilog.lua index a41731d..4f3a743 100644 --- a/.config/nvim/after/ftplugin/verilog.lua +++ b/.config/nvim/after/ftplugin/verilog.lua @@ -7,7 +7,8 @@ utils.map("n", "", "CoqInterrupt") utils.map("n", "j", "CoqNext") utils.map("n", "k", "CoqUndo") utils.map("n", "", "CoqToLine") -utils.map("n", "a", "Coq About") -utils.map("n", "G", "CoqJumpToEnd") +utils.map("n", "a", ":Coq About") +utils.map("n", "s", ":Coq Search") +utils.map("n", "G", "CoqJumpToEnd") utils.map("i", "//", "∥") diff --git a/.config/nvim/lua/lsp/lua.lua b/.config/nvim/lua/lsp/lua.lua index 7e55549..7328492 100644 --- a/.config/nvim/lua/lsp/lua.lua +++ b/.config/nvim/lua/lsp/lua.lua @@ -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 = { diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index ee37983..0764807 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -7,7 +7,7 @@ utils.map("n", "", "") utils.map("n", "y", "\"+y") utils.map("n", "p", "\"+P") utils.map("n", "", "w! | !compiler %") -utils.map("n", "s", "PackerSync") +utils.map("n", "u", "PackerSync") utils.map("n", "c", "ColorizerToggle") -- LSP diff --git a/.config/nvim/lua/plugin/cmp.lua b/.config/nvim/lua/plugin/cmp.lua index fee7dda..c620fec 100644 --- a/.config/nvim/lua/plugin/cmp.lua +++ b/.config/nvim/lua/plugin/cmp.lua @@ -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 diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 6ee4b19..d9b0148 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -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", diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index c52b485..a072d61 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -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" diff --git a/.local/bin/dmenuopen b/.local/bin/dmenuopen index 9ac96a1..6894892 100755 --- a/.local/bin/dmenuopen +++ b/.local/bin/dmenuopen @@ -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 diff --git a/.local/bin/switch-colors b/.local/bin/switch-colors index 7652b17..2a77336 100755 --- a/.local/bin/switch-colors +++ b/.local/bin/switch-colors @@ -46,5 +46,3 @@ else switch_scheme fi fi - -exit 0 diff --git a/.local/src/astronomy.nvim b/.local/src/astronomy.nvim index c329ff4..d77e1cf 160000 --- a/.local/src/astronomy.nvim +++ b/.local/src/astronomy.nvim @@ -1 +1 @@ -Subproject commit c329ff44d3aef42e8347563bf7ae119b5a2a2d70 +Subproject commit d77e1cfe127418ab00c6d5fb076f89cdf9b49e94