diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2024-10-17 22:46:39 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2024-10-17 22:46:39 -0500 |
commit | 78d5e2082554d370f43216406f84872eaa2a4e5b (patch) | |
tree | fc354e842111062c057484cbb319e02037404975 /nvim/lua/tjk/misc.lua | |
parent | 75793a911de3648963385c70237fc737f1967e9d (diff) | |
download | dotconfig-78d5e2082554d370f43216406f84872eaa2a4e5b.tar.xz dotconfig-78d5e2082554d370f43216406f84872eaa2a4e5b.zip |
remove zsh and nvim configs from this repo and move to another
Diffstat (limited to 'nvim/lua/tjk/misc.lua')
-rw-r--r-- | nvim/lua/tjk/misc.lua | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/nvim/lua/tjk/misc.lua b/nvim/lua/tjk/misc.lua deleted file mode 100644 index 14c5bd8..0000000 --- a/nvim/lua/tjk/misc.lua +++ /dev/null @@ -1,75 +0,0 @@ --- Use tabs instead of spaces for certain filetypes -local tabs_instead_of_spaces_filetypes = { - "sass", - "scss", -} - -local tabs_instead_of_spaces = function(args) - local o = vim.opt_local - o.expandtab = false - --o.cinoptions = true - o.preserveindent = true - o.softtabstop = 0 - o.shiftwidth = 4 - o.tabstop = 4 -end -vim.api.nvim_create_autocmd("FileType", { pattern = tabs_instead_of_spaces_filetypes, callback = tabs_instead_of_spaces }) - - -vim.cmd [[ - "" Extra functionality - - "" Functions for changing the terminal emulator's class name to 'Vim' - "function GetTermPID(temu) - " let pinfo = ['', getpid(), ''] - " while !(pinfo[2] =~ a:temu || pinfo[1] == '0') - " let pinfo = split(system('ps h -o pid,ppid,command= -p' . pinfo[1])) - " endwhile - " return pinfo[0] - "endfunction - - "function SetTermClassName(termpid, name) - " " Command chaining in xdotool doesn't work here for some reason - " silent exec "!xdotool set_window --class " . a:name . " $(xdotool search --pid " . a:termpid . ")" - "endfunction - - "" Behaviors exclusive to either a tty or a graphical terminal emulator - "if empty($DISPLAY) - " " Clear the tty screen after exiting vim - " autocmd VimLeave * :clear - "else - " " Highlight current line - " set cursorline - " " Change window title - " autocmd BufEnter * :set title - " let &titleold="st" - " " Change class name - " let temu = "st" - " let temupid = GetTermPID(temu) - " if (temupid != 1) - " autocmd VimEnter * call SetTermClassName(temupid, "Vim") - " autocmd VimLeave * call SetTermClassName(temupid, temu) - " endif - "endif - - " Automatically deletes all trailing whitespace on save - function DelWS() - let l:save_view = winsaveview() - :%s/\s*$//e - call winrestview(l:save_view) - endfunction - autocmd BufWritePre * call DelWS() - - - " vim -b : edit binary using xxd-format! - augroup Binary - au! - au BufReadPre *.bin let &bin=1 - au BufReadPost *.bin if &bin | %!xxd - au BufReadPost *.bin set ft=xxd | endif - au BufWritePre *.bin if &bin | %!xxd -r - au BufWritePre *.bin endif - au BufWritePost *.bin if &bin | %!xxd - au BufWritePost *.bin set nomod | endif - augroup END -]] |