diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/essentials/vis/backup.lua | 6 | ||||
| -rw-r--r-- | config/essentials/vis/format.lua | 18 | ||||
| -rw-r--r-- | config/essentials/vis/fzf-mru.lua | 2 | ||||
| -rw-r--r-- | config/essentials/vis/visrc.lua | 8 | ||||
| -rw-r--r-- | config/extra/zathura/zathurarc | 36 | 
5 files changed, 35 insertions, 35 deletions
diff --git a/config/essentials/vis/backup.lua b/config/essentials/vis/backup.lua index 7c44c60..2c8f0b8 100644 --- a/config/essentials/vis/backup.lua +++ b/config/essentials/vis/backup.lua @@ -20,6 +20,10 @@ end  -- Before saving the file, copy the current contents of the file to a backup file  vis.events.subscribe(vis.events.FILE_SAVE_PRE, function(file, path) +	if file == nil then +		return +	end +  	if file.size > backup.byte_limit then  		return  	end @@ -46,7 +50,7 @@ vis.events.subscribe(vis.events.FILE_SAVE_PRE, function(file, path)  end)  -- Set defaults -backup.directory = os.getenv("XDG_DATA_HOME") .. "/Trash/vis-backups" +backup.directory = (os.getenv("XDG_DATA_HOME") or (os.getenv("HOME") .. "/.local/share")) .. "/Trash/vis-backups"  backup.get_fname = backup.entire_path_with_double_percentage_signs diff --git a/config/essentials/vis/format.lua b/config/essentials/vis/format.lua index 67613a6..eefdc77 100644 --- a/config/essentials/vis/format.lua +++ b/config/essentials/vis/format.lua @@ -63,15 +63,15 @@ M.formatters = {  		end,  	},  	luaformatter = M.stdio_formatter("lua-format"), -	markdown = M.stdio_formatter(function(win) -		if win.options and M.wrapwidth ~= 0 then -			return "prettier --parser markdown --prose-wrap always " -				.. ("--print-width " .. (M.wrapwidth - 1) .. " ") -				.. M.with_filename(win, "--stdin-filepath ") -		else -			return "prettier --parser markdown " .. M.with_filename(win, "--stdin-filepath ") -		end -	end, { ranged = false }), +	-- markdown = M.stdio_formatter(function(win) +		-- if win.options and M.wrapwidth ~= 0 then +			-- return "prettier --parser markdown --prose-wrap always " +				-- .. ("--print-width " .. (M.wrapwidth - 1) .. " ") +				-- .. M.with_filename(win, "--stdin-filepath ") +		-- else +			-- return "prettier --parser markdown " .. M.with_filename(win, "--stdin-filepath ") +		-- end +	-- end, { ranged = false }),  	powershell = M.stdio_formatter([[      "$( (command -v powershell.exe || command -v pwsh) 2>/dev/null )" -c '          Invoke-Formatter  -ScriptDefinition ` diff --git a/config/essentials/vis/fzf-mru.lua b/config/essentials/vis/fzf-mru.lua index 455d083..8408dd7 100644 --- a/config/essentials/vis/fzf-mru.lua +++ b/config/essentials/vis/fzf-mru.lua @@ -10,7 +10,7 @@ Changes made:  --]]  local M = {} -M.fzf_filepath = os.getenv("XDG_CACHE_HOME") .. "/vis-fzf-mru" +M.fzf_filepath = (os.getenv("XDG_CACHE_HOME") or (os.getenv("HOME") .. "/.local/share")).. "/vis-fzf-mru"  M.fzf_path = "fzf"  M.fzf_args = "--height=40%"  M.fzf_history = 20 diff --git a/config/essentials/vis/visrc.lua b/config/essentials/vis/visrc.lua index 577712a..b56b6af 100644 --- a/config/essentials/vis/visrc.lua +++ b/config/essentials/vis/visrc.lua @@ -25,7 +25,7 @@ local format = require("format")  -- set height to 40%  local fzfmru = require("fzf-mru") -fzfmru.fzfmru_path = 'grep "^' .. os.getenv("PWD") .. '" | fzf' +fzfmru.fzfmru_path = 'grep "^' .. io.popen("pwd"):read("*a"):gsub("\n$", "") .. '" | fzf'  -- todo:  -- c-scope @@ -120,9 +120,9 @@ end)  vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args  	-- automatically cd in parent dir of file  	vis:command_register("cdp", function() -		if win.file and win.file.path then -			local dir = win.file.path:match(".*/") -			vis:command("cd " .. dir) +		if win and win.file and win.file.path then +			-- local dir = win.file.path:match(".*/") +			-- vis:info("cd " .. tostring(dir))  		end  	end, "Cd to parent dir of file") diff --git a/config/extra/zathura/zathurarc b/config/extra/zathura/zathurarc index a78ef16..41e1980 100644 --- a/config/extra/zathura/zathurarc +++ b/config/extra/zathura/zathurarc @@ -1,23 +1,19 @@ -# fullscreen mappings -map   [fullscreen]              r            reload -map   [fullscreen]              R            rotate -map   [fullscreen]              i            zoom in -map   [fullscreen]              o            zoom out -  # normal mappings -map		r				reload -map		R				rotate -map		i				zoom in -map		o				zoom out -map		f				toggle_fullscreen -map		x				toggle_statusbar -map		X				toggle_index +map r reload +map R rotate +map i zoom in +map o zoom out +map f toggle_fullscreen +map x toggle_statusbar +map X toggle_index -set   font                      "monospace bold 11" -set   adjust-open               "best-fit" -set   pages-per-row             1 -set   scroll-page-aware         "true" -set   scroll-full-overlap       0.01 -set   scroll-step               100 +set font                      "monospace bold 11" +set adjust-open               "best-fit" +set pages-per-row             1 +set scroll-page-aware         "true" +set scroll-full-overlap       0.01 +set scroll-step               100 -set   guioptions                " " +set guioptions          	" " +set database            	"sqlite" +set continuous-hist-save	true  | 
