repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: toggle term on F12 and fix map options bug nushell: do not mess around with PATH/Path

25d56e42da22be766770a1a6415eebb491931b23

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (4)

neovim/lua/bugabinga/options/ui.lua

Modified
129 129 -- font
130 130 vim.opt.guifont = 'Cousine,Symbols Nerd Font Mono:h16:#e-subpixelantialias:#h-none'
131 --- NOTE: neovide font config is not as powerful as wezterm right now
132 --- characters for box drawing do not seem to line up. try different font for now?
133 -vim.opt.linespace = -3
135 132 -- neovide only options
136 133 if vim.g.neovide then
137 - vim.g.neovide_floating_blur_amount_x = 12.0
138 - vim.g.neovide_floating_blur_amount_y = 12.0
139 - -- vim.g.neovide_scroll_animation_length = 0.69
140 - vim.g.neovide_fullscreen = true
141 - vim.g.neovide_remember_window_size = true
142 - vim.g.neovide_profiler = false
143 - -- vim.g.neovide_cursor_animation_length = 0.42
144 - -- vim.g.neovide_cursor_trail_length = 0.42
145 - vim.g.neovide_cursor_vfx_mode = 'railgun'
146 - -- vim.g.neovide_cursor_unfocused_outline_width = 0.125
147 - vim.g.neovide_cursor_antialiasing = true
134 + -- vim.g.neovide_profiler = false
135 + -- interpret all touch events as scroll events
136 + vim.g.neovide_touch_deadzone = 0.0
137 + -- after this timeout, start a visual selection
138 + vim.g.neovide_touch_drag_timeout = 0.69
148 139 vim.g.neovide_padding_top = 0
140 + vim.g.neovide_padding_left = 8
149 141 vim.g.neovide_padding_bottom = 0
150 142 vim.g.neovide_padding_right = 0
151 - vim.g.neovide_padding_left = 0
152 143 vim.g.neovide_hide_mouse_when_typing = true
153 - vim.g.neovide_theme = 'auto'
154 144 vim.g.neovide_refresh_rate_idle = 5

neovim/lua/bugabinga/terminal.lua

Modified
4 4 local map = require 'std.map'
5 5 local auto = require 'std.auto'
7 7 map.normal {
8 8 description = 'Open terminal in a split',
9 9 category = 'terminal',
10 - keys = '<F7>',
10 + keys = '<F12>',
11 11 command = function ()
12 12 local cwd = vim.uv.cwd()
13 13 ---@diagnostic disable-next-line: undefined-field
14 14 local shell = vim.opt.shell:get()
15 - local open_term_cmd = string.format( 'split term://%s//%s', cwd, shell )
15 + -- paths in term names seem to be relative to home
16 + local relative_cwd = vim.fn.fnamemodify( cwd, ':~' )
17 + local term_name = string.format( 'term://%s//%s', relative_cwd, shell )
18 + local buffers = vim.api.nvim_list_bufs()
19 + local existing_term = vim.iter( buffers ):map( function ( buffer_number )
20 + return { buffer_number, vim.api.nvim_buf_get_name( buffer_number ), }
21 + end ):filter( function ( buffer )
22 + return string.find( buffer[2], relative_cwd, 1, true )
23 + end ):next()
24 + if existing_term then
25 + term_name = existing_term[2]
26 + end
27 + local open_term_cmd = string.format( 'split %s', term_name )
16 28 vim.cmd( open_term_cmd )
17 29 end,
20 32 local terminal_settings = function ()
21 33 map.terminal {
22 - description = 'Quit insert mode via <esc>',
34 + description = 'Quit terminal mode via <esc>',
23 35 category = 'terminal',
24 36 keys = '<esc>',
25 37 buffer = true,
26 38 command = [[ <C-\><C-n> ]],
41 + map.normal.terminal {
42 + description = 'Close.',
43 + category = 'terminal',
44 + keys = '<F12>',
45 + buffer = true,
46 + command = [[<cmd>close<cr>]],
47 + }
29 49 vim.opt_local.spell = false
30 50 vim.cmd.startinsert()

neovim/lua/std/map.lua

Modified
49 49 local options = vim.tbl_extend("keep", map.options, {
50 50 silent = true,
51 51 desc = map.description,
52 + buffer = map.buffer,
53 + remap = map.remap,
54 56 if vim.tbl_isempty(self.modes) then
55 57 self.modes[1] = available_modes.normal_visual_select_operator_pending
60 + -- vim.print('vim.keymap', self.modes, keys, command, options)
58 62 if type(keys) == "table" then
59 63 for _, key in ipairs(keys) do
60 64 vim.keymap.set(self.modes, key, command, options)

nushell/env.nu

Modified
46 46 ($nu.config-path | path dirname | path join 'completions')
49 -if $env.WIN32 {
50 - # TODO: insert scoop cargo path here
51 - # $env.CARGO_HOME = ( '~/.cargo' | path expand )
52 - $env.Path = ( $env.Path | prepend '' )
53 -} else {
54 - $env.CARGO_HOME = ( '~/.cargo' | path expand )
55 - $env.PATH = ( $env.PATH | prepend ( $env.CARGO_HOME | path join 'bin') )
56 - $env.PATH = ( $env.PATH | prepend ( '~/.local/bin'| path expand ) )
57 -}