treesitter config

This commit is contained in:
Barak Michener 2022-04-12 10:08:57 -07:00
parent 1b9408c46e
commit d8a623b5b8
16 changed files with 214 additions and 92 deletions

View file

@ -1,12 +1,4 @@
set -g VIRTUALFISH_VERSION 2.5.4
set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python3
if test -e /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish
source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish
else if test -e /usr/local/lib/python3.9/site-packages/virtualfish/virtual.fish
source /usr/local/lib/python3.9/site-packages/virtualfish/virtual.fish
else if test -e /usr/lib/python3.9/site-packages/virtualfish/virtual.fish
source /usr/lib/python3.9/site-packages/virtualfish/virtual.fish
else if test -e /usr/lib/python3.10/site-packages/virtualfish/virtual.fish
source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish
end
emit virtualfish_did_setup_plugins
set -g VIRTUALFISH_PYTHON_EXEC /bin/python
source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish
emit virtualfish_did_setup_plugins

View file

@ -1,6 +1,6 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3100
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:005fd7
@ -28,3 +28,4 @@ SETUVAR fish_pager_color_completion:\x1d
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr

View file

@ -19,7 +19,7 @@ k9s:
clusters:
kubernetes:
namespace:
active: ""
active: all
favorites:
- all
- default
@ -43,3 +43,4 @@ k9s:
memory:
critical: 90
warn: 70
screenDumpDir: /tmp/k9s-screens-barak

View file

@ -38,6 +38,10 @@
<property name="X" type="int" value="0"/>
<property name="Y" type="int" value="0"/>
</property>
<property name="Scale" type="empty">
<property name="X" type="double" value="1.000000"/>
<property name="Y" type="double" value="1.000000"/>
</property>
</property>
<property name="DP-3" type="string" value="DO NOT USE - RTK 27&quot;">
<property name="Active" type="bool" value="true"/>
@ -51,6 +55,10 @@
<property name="X" type="int" value="0"/>
<property name="Y" type="int" value="0"/>
</property>
<property name="Scale" type="empty">
<property name="X" type="double" value="1.000000"/>
<property name="Y" type="double" value="1.000000"/>
</property>
</property>
</property>
<property name="ActiveProfile" type="string" value="Default"/>
@ -67,6 +75,10 @@
<property name="X" type="int" value="0"/>
<property name="Y" type="int" value="0"/>
</property>
<property name="Scale" type="empty">
<property name="X" type="double" value="1.000000"/>
<property name="Y" type="double" value="1.000000"/>
</property>
</property>
<property name="DP-3" type="string" value="DO NOT USE - RTK 27&quot;">
<property name="Active" type="bool" value="true"/>
@ -80,6 +92,10 @@
<property name="X" type="int" value="0"/>
<property name="Y" type="int" value="0"/>
</property>
<property name="Scale" type="empty">
<property name="X" type="double" value="1.000000"/>
<property name="Y" type="double" value="1.000000"/>
</property>
</property>
</property>
</channel>

View file

@ -4,8 +4,8 @@
<property name="misc-volume-management" type="empty"/>
<property name="shortcuts-icon-size" type="empty"/>
<property name="last-view" type="string" value="ThunarIconView"/>
<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_NORMAL"/>
<property name="last-window-width" type="int" value="2556"/>
<property name="last-window-height" type="int" value="1411"/>
<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_75_PERCENT"/>
<property name="last-window-width" type="int" value="1274"/>
<property name="last-window-height" type="int" value="2121"/>
<property name="last-window-maximized" type="bool" value="false"/>
</channel>

View file

@ -29,6 +29,28 @@
<property name="image-style" type="empty"/>
<property name="image-show" type="empty"/>
</property>
<property name="monitorHDMI-1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/>
</property>
<property name="workspace1" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/>
</property>
<property name="workspace2" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/>
</property>
<property name="workspace3" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/>
</property>
</property>
</property>
</property>
</channel>

View file

@ -7,8 +7,11 @@
<property name="applications" type="empty">
<property name="known_applications" type="array">
<value type="string" value="Firefox"/>
<value type="string" value="google-chrome"/>
<value type="string" value="nm-applet"/>
<value type="string" value="notify-send"/>
<value type="string" value="org.gnome.Evolution-alarm-notify"/>
<value type="string" value="Spotify"/>
<value type="string" value="Xfce volume control"/>
<value type="string" value="xfce4-settings-helper"/>
</property>

View file

@ -7,6 +7,7 @@
<property name="length" type="uint" value="100"/>
<property name="position-locked" type="bool" value="true"/>
<property name="plugin-ids" type="array">
<value type="int" value="7"/>
<value type="int" value="12"/>
<value type="int" value="2"/>
<value type="int" value="3"/>
@ -46,21 +47,22 @@
<value type="string" value="remmina"/>
</property>
<property name="names-ordered" type="array">
<value type="string" value="remmina"/>
<value type="string" value="hexchat"/>
<value type="string" value="obs"/>
</property>
</property>
<property name="plugin-7" type="string" value="statusnotifier">
<property name="icon-size" type="uint" value="22"/>
<property name="menu-is-primary" type="bool" value="true"/>
<property name="mode-whitelist" type="bool" value="false"/>
<property name="single-row" type="bool" value="false"/>
<property name="square-icons" type="bool" value="false"/>
<property name="symbolic-icons" type="bool" value="true"/>
<property name="known-items" type="array">
<value type="string" value="chrome_status_icon_1"/>
<value type="string" value="Barrier"/>
<value type="string" value="discord1"/>
<value type="string" value="vlc"/>
<value type="string" value="obs"/>
<value type="string" value="remmina-icon"/>
<value type="string" value="blueman"/>
<value type="string" value="nm-applet"/>
</property>
<property name="known-legacy-items" type="array">
<value type="string" value="reminders"/>
<value type="string" value="evolution-alarm-notify"/>
<value type="string" value="remmina"/>
</property>
</property>
<property name="plugin-9" type="string" value="pulseaudio">
@ -86,7 +88,10 @@
<property name="plugin-5" type="string" value="cpugraph"/>
<property name="plugin-6" type="string" value="pulseaudio">
<property name="enable-keyboard-shortcuts" type="bool" value="true"/>
<property name="mpris-players" type="string" value="chrome.instance486584;firefox.instance177030;firefox.instance435270;firefox.instance47310;kdeconnect.mpris_139c920d94b14a47b3c01f1cb40b9a31"/>
<property name="mpris-players" type="string" value="chrome.instance486584;firefox.instance139344;firefox.instance177030;firefox.instance354219;firefox.instance435270;firefox.instance47310;firefox.instance67698;firefox.instance8847;firefox.instance984;kdeconnect.mpris_139c920d94b14a47b3c01f1cb40b9a31;spotify;vlc"/>
</property>
<property name="plugin-7" type="string" value="applicationsmenu">
<property name="show-button-title" type="bool" value="false"/>
</property>
</property>
<property name="configver" type="int" value="2"/>

View file

@ -5,11 +5,11 @@
<property name="power-button-action" type="empty"/>
<property name="lock-screen-suspend-hibernate" type="bool" value="false"/>
<property name="logind-handle-lid-switch" type="empty"/>
<property name="blank-on-ac" type="int" value="30"/>
<property name="blank-on-ac" type="int" value="60"/>
<property name="blank-on-battery" type="empty"/>
<property name="dpms-enabled" type="bool" value="false"/>
<property name="dpms-on-ac-sleep" type="uint" value="36"/>
<property name="dpms-on-ac-off" type="uint" value="37"/>
<property name="dpms-on-ac-sleep" type="uint" value="60"/>
<property name="dpms-on-ac-off" type="uint" value="60"/>
<property name="dpms-on-battery-sleep" type="empty"/>
<property name="dpms-on-battery-off" type="empty"/>
<property name="show-panel-label" type="empty"/>

View file

@ -3,7 +3,8 @@
<channel name="xfce4-session" version="1.0">
<property name="general" type="empty">
<property name="FailsafeSessionName" type="empty"/>
<property name="SaveOnExit" type="empty"/>
<property name="LockCommand" type="empty"/>
<property name="SaveOnExit" type="bool" value="true"/>
<property name="SessionName" type="string" value="Default"/>
</property>
<property name="sessions" type="empty">
@ -11,14 +12,19 @@
<property name="IsFailsafe" type="empty"/>
<property name="Count" type="empty"/>
<property name="Client0_Command" type="empty"/>
<property name="Client0_Priority" type="empty"/>
<property name="Client0_PerScreen" type="empty"/>
<property name="Client1_Command" type="empty"/>
<property name="Client1_Priority" type="empty"/>
<property name="Client1_PerScreen" type="empty"/>
<property name="Client2_Command" type="empty"/>
<property name="Client2_Priority" type="empty"/>
<property name="Client2_PerScreen" type="empty"/>
<property name="Client3_Command" type="empty"/>
<property name="Client3_Priority" type="empty"/>
<property name="Client3_PerScreen" type="empty"/>
<property name="Client4_Command" type="empty"/>
<property name="Client4_Priority" type="empty"/>
<property name="Client4_PerScreen" type="empty"/>
</property>
</property>

View file

@ -2,7 +2,7 @@
<channel name="xfce4-settings-manager" version="1.0">
<property name="last" type="empty">
<property name="window-width" type="int" value="850"/>
<property name="window-height" type="int" value="500"/>
<property name="window-width" type="int" value="948"/>
<property name="window-height" type="int" value="2032"/>
</property>
</channel>

View file

@ -2,66 +2,67 @@
<channel name="xfwm4" version="1.0">
<property name="general" type="empty">
<property name="activate_action" type="empty"/>
<property name="box_move" type="empty"/>
<property name="box_resize" type="empty"/>
<property name="button_layout" type="empty"/>
<property name="button_offset" type="empty"/>
<property name="button_spacing" type="empty"/>
<property name="click_to_focus" type="empty"/>
<property name="cycle_apps_only" type="empty"/>
<property name="cycle_draw_frame" type="empty"/>
<property name="cycle_preview" type="empty"/>
<property name="double_click_distance" type="empty"/>
<property name="double_click_time" type="empty"/>
<property name="focus_delay" type="empty"/>
<property name="focus_new" type="empty"/>
<property name="frame_opacity" type="empty"/>
<property name="full_width_title" type="empty"/>
<property name="maximized_offset" type="empty"/>
<property name="mousewheel_rollup" type="empty"/>
<property name="placement_mode" type="empty"/>
<property name="raise_delay" type="empty"/>
<property name="raise_on_click" type="empty"/>
<property name="raise_on_focus" type="empty"/>
<property name="repeat_urgent_blink" type="empty"/>
<property name="scroll_workspaces" type="empty"/>
<property name="shadow_delta_height" type="empty"/>
<property name="shadow_delta_width" type="empty"/>
<property name="shadow_delta_x" type="empty"/>
<property name="shadow_delta_y" type="empty"/>
<property name="shadow_opacity" type="empty"/>
<property name="show_app_icon" type="empty"/>
<property name="show_dock_shadow" type="empty"/>
<property name="show_frame_shadow" type="empty"/>
<property name="show_popup_shadow" type="empty"/>
<property name="snap_to_border" type="empty"/>
<property name="snap_to_windows" type="empty"/>
<property name="snap_width" type="empty"/>
<property name="theme" type="empty"/>
<property name="title_alignment" type="empty"/>
<property name="title_font" type="empty"/>
<property name="title_horizontal_offset" type="empty"/>
<property name="title_shadow_active" type="empty"/>
<property name="title_shadow_inactive" type="empty"/>
<property name="title_vertical_offset_active" type="empty"/>
<property name="title_vertical_offset_inactive" type="empty"/>
<property name="urgent_blink" type="empty"/>
<property name="use_compositing" type="empty"/>
<property name="workspace_count" type="int" value="4"/>
<property name="activate_action" type="string" value="bring"/>
<property name="box_move" type="bool" value="false"/>
<property name="box_resize" type="bool" value="false"/>
<property name="button_layout" type="string" value="O|SHMC"/>
<property name="button_offset" type="int" value="0"/>
<property name="button_spacing" type="int" value="0"/>
<property name="click_to_focus" type="bool" value="true"/>
<property name="cycle_apps_only" type="bool" value="false"/>
<property name="cycle_draw_frame" type="bool" value="true"/>
<property name="cycle_preview" type="bool" value="true"/>
<property name="double_click_distance" type="int" value="5"/>
<property name="double_click_time" type="int" value="250"/>
<property name="focus_delay" type="int" value="250"/>
<property name="focus_new" type="bool" value="true"/>
<property name="frame_opacity" type="int" value="100"/>
<property name="full_width_title" type="bool" value="true"/>
<property name="maximized_offset" type="int" value="0"/>
<property name="mousewheel_rollup" type="bool" value="true"/>
<property name="placement_mode" type="string" value="center"/>
<property name="raise_delay" type="int" value="250"/>
<property name="raise_on_click" type="bool" value="true"/>
<property name="raise_on_focus" type="bool" value="false"/>
<property name="repeat_urgent_blink" type="bool" value="false"/>
<property name="scroll_workspaces" type="bool" value="true"/>
<property name="shadow_delta_height" type="int" value="0"/>
<property name="shadow_delta_width" type="int" value="0"/>
<property name="shadow_delta_x" type="int" value="0"/>
<property name="shadow_delta_y" type="int" value="-3"/>
<property name="shadow_opacity" type="int" value="50"/>
<property name="show_app_icon" type="bool" value="false"/>
<property name="show_dock_shadow" type="bool" value="true"/>
<property name="show_frame_shadow" type="bool" value="true"/>
<property name="show_popup_shadow" type="bool" value="false"/>
<property name="snap_to_border" type="bool" value="true"/>
<property name="snap_to_windows" type="bool" value="false"/>
<property name="snap_width" type="int" value="10"/>
<property name="theme" type="string" value="Default"/>
<property name="title_alignment" type="string" value="center"/>
<property name="title_font" type="string" value="Sans Bold 9"/>
<property name="title_horizontal_offset" type="int" value="0"/>
<property name="title_shadow_active" type="string" value="false"/>
<property name="title_shadow_inactive" type="string" value="false"/>
<property name="title_vertical_offset_active" type="int" value="0"/>
<property name="title_vertical_offset_inactive" type="int" value="0"/>
<property name="urgent_blink" type="bool" value="false"/>
<property name="use_compositing" type="bool" value="true"/>
<property name="workspace_count" type="int" value="5"/>
<property name="workspace_names" type="array">
<value type="string" value="1"/>
<value type="string" value="2"/>
<value type="string" value="3"/>
<value type="string" value="5"/>
<value type="string" value="6"/>
<value type="string" value="7"/>
<value type="string" value="9"/>
<value type="string" value="10"/>
<value type="string" value="10"/>
<value type="string" value="Workspace 8"/>
<value type="string" value="9"/>
</property>
<property name="wrap_resistance" type="empty"/>
<property name="wrap_windows" type="empty"/>
<property name="wrap_workspaces" type="empty"/>
<property name="wrap_resistance" type="int" value="10"/>
<property name="wrap_windows" type="bool" value="true"/>
<property name="wrap_workspaces" type="bool" value="false"/>
<property name="borderless_maximize" type="bool" value="true"/>
<property name="cycle_hidden" type="bool" value="true"/>
<property name="cycle_minimum" type="bool" value="true"/>
@ -87,5 +88,10 @@
<property name="wrap_cycle" type="bool" value="true"/>
<property name="wrap_layout" type="bool" value="true"/>
<property name="zoom_desktop" type="bool" value="true"/>
<property name="cycle_raise" type="bool" value="false"/>
<property name="cycle_minimized" type="bool" value="false"/>
<property name="frame_border_top" type="int" value="0"/>
<property name="vblank_mode" type="string" value="auto"/>
<property name="zoom_pointer" type="bool" value="true"/>
</property>
</channel>

View file

@ -2,7 +2,7 @@
<channel name="xsettings" version="1.0">
<property name="Net" type="empty">
<property name="ThemeName" type="string" value="Arc-Dark"/>
<property name="ThemeName" type="string" value="Adwaita-dark"/>
<property name="IconThemeName" type="string" value="Arc"/>
<property name="DoubleClickTime" type="empty"/>
<property name="DoubleClickDistance" type="empty"/>
@ -15,7 +15,7 @@
<property name="FallbackIconTheme" type="empty"/>
</property>
<property name="Xft" type="empty">
<property name="DPI" type="int" value="150"/>
<property name="DPI" type="int" value="130"/>
<property name="Antialias" type="int" value="1"/>
<property name="Hinting" type="int" value="1"/>
<property name="HintStyle" type="string" value="hintslight"/>
@ -37,11 +37,13 @@
<property name="CursorThemeName" type="string" value="elementary"/>
<property name="CursorThemeSize" type="empty"/>
<property name="DecorationLayout" type="empty"/>
<property name="DialogsUseHeader" type="empty"/>
<property name="TitlebarMiddleClick" type="empty"/>
</property>
<property name="Gdk" type="empty">
<property name="WindowScalingFactor" type="empty"/>
</property>
<property name="Xfce" type="empty">
<property name="LastCustomDPI" type="int" value="150"/>
<property name="LastCustomDPI" type="int" value="130"/>
</property>
</channel>

View file

@ -20,6 +20,7 @@ bind-key C-p previous-window
set -g set-titles off
set -g mouse on
set -g default-terminal tmux-256color
set-option -g default-shell /bin/fish
setw -g mode-keys vi
new -d
@ -36,6 +37,7 @@ bind - split-window -v
bind v split-window -h
bind = select-layout even-horizontal
bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`"
# Status Bar
#set -g status-bg black

View file

@ -26,6 +26,35 @@ nvim_lsp.gopls.setup({ on_attach=on_attach })
nvim_lsp.pyright.setup({ on_attach=on_attach })
nvim_lsp.clangd.setup({ on_attach=on_attach })
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 {
settings = {
Lua = {
runtime = {
-- 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 = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
function org_imports(wait_ms)
local params = vim.lsp.util.make_range_params()
@ -298,7 +327,7 @@ require'nvim-treesitter.configs'.setup {
enable = true,
-- list of language that will be disabled
disable = { "c", "rust" },
-- disable = { "c", "rust" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
@ -331,6 +360,13 @@ require'nvim-treesitter.configs'.setup {
}
}
require"nvim-treesitter.highlight".set_custom_captures {
-- Highlight the @foo.bar capture group with the "Identifier" highlight group.
-- ["foo.bar"] = "Identifier",
["generic_type_param"] = "TSCGenericTypeParam",
}
require"neogen".setup {}
--
-- Helper functions for my own grepping commands.
@ -408,3 +444,30 @@ function rust_where_at_line()
vim.api.nvim_buf_set_lines(0, lineNum-1, lineNum, false, replacements)
vim.api.nvim_win_set_cursor(0, {lineNum + 2, 4})
end
function neogen_dwim()
local table = {
["function_declaration"] = "func",
["function_definition"] = "func",
["function_item"] = "func",
["function_signature_item"] = "func",
["struct_item"] = "class",
["trait_item"] = "class",
["package_clause"] = "type",
["const_declaration"] = "type",
["var_declaration"] = "type",
["class_definition"] = "class",
}
local ts_utils = require'nvim-treesitter.ts_utils'
local current_node = ts_utils.get_node_at_cursor()
while (current_node) do
local v = table[current_node:type()]
if v then
require('neogen').generate({ type = v })
break
else
current_node = current_node:parent()
end
end
end

9
.vimrc
View file

@ -238,6 +238,7 @@ Plug 'lervag/vimtex'
Plug 'Shougo/echodoc.vim'
"Plug 'python-rope/ropevim'
Plug 'windwp/nvim-autopairs'
Plug 'danymat/neogen'
" Unclear
"Plug 'ncm2/float-preview.nvim'
@ -275,7 +276,9 @@ vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_act
"nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR>
nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR>
nnoremap <leader>xx <cmd>TroubleToggle<cr>
nnoremap <silent> <leader>xx <cmd>TroubleToggle<cr>
"nnoremap <silent> <leader>nc <cmd>lua neogen_dwim()<CR>
nnoremap <silent> <leader>nc <cmd>lua require('neogen').generate({ type = 'any' })<CR>
" Set updatetime for CursorHold
" 300ms of no cursor movement to trigger CursorHold
@ -291,8 +294,8 @@ autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000)
autocmd BufWritePre *.go :silent! lua org_imports(3000)
" Goto previous/next diagnostic warning/error
nnoremap <silent> g[ <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
nnoremap <silent> g] <cmd>lua vim.lsp.diagnostic.goto_next()<CR>
nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR>
nnoremap <silent> g] <cmd>lua vim.diagnostic.goto_next()<CR>
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
let g:completion_matching_smart_case = 1