Add files for OpenBSD
This commit is contained in:
parent
77ba9e34c9
commit
f36ba9e59f
|
@ -0,0 +1,28 @@
|
|||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2023, Eduardo Cueto-Mendoza
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,32 @@
|
|||
[general]
|
||||
live_config_reload = true
|
||||
|
||||
import = [
|
||||
"~/.config/alacritty/themes/Homebrew.toml"
|
||||
]
|
||||
|
||||
[cursor.style]
|
||||
shape = "Block"
|
||||
|
||||
[font]
|
||||
size = 20
|
||||
normal = { family = "Terminess Nerd Font", style = "Regular" }
|
||||
bold = { family = "Terminess Nerd Font", style = "Bold" }
|
||||
italic = { family = "Terminess Nerd Font", style = "Italic" }
|
||||
bold_italic = { family = "Terminess Nerd Font", style = "Bold Italic" }
|
||||
builtin_box_drawing = false
|
||||
|
||||
[scrolling]
|
||||
history = 100000
|
||||
|
||||
[selection]
|
||||
save_to_clipboard = true
|
||||
|
||||
[window]
|
||||
opacity = 0.85
|
||||
startup_mode = "Maximized"
|
||||
|
||||
[keyboard]
|
||||
bindings = [
|
||||
{key="Space", mods="Command | Shift", mode="AppCursor | AppKeypad | ~Search | Alt | Vi", command="ToggleViMode"},
|
||||
]
|
|
@ -0,0 +1,35 @@
|
|||
# Colors (Homebrew)
|
||||
|
||||
[colors.bright]
|
||||
black = '#666666'
|
||||
#blue = '#0000ff'
|
||||
blue = '#0000b2'
|
||||
cyan = '#00e5e5'
|
||||
green = '#00d900'
|
||||
magenta = '#e500e5'
|
||||
red = '#e50000'
|
||||
white = '#e5e5e5'
|
||||
yellow = '#e5e500'
|
||||
|
||||
[colors.cursor]
|
||||
cursor = '#23ff18'
|
||||
text = '#ff0018'
|
||||
|
||||
[colors.normal]
|
||||
black = '#000000'
|
||||
#blue = '#0000b2'
|
||||
blue = '#0000ff'
|
||||
cyan = '#00a6b2'
|
||||
green = '#00a600'
|
||||
magenta = '#b200b2'
|
||||
red = '#990000'
|
||||
white = '#bfbfbf'
|
||||
yellow = '#999900'
|
||||
|
||||
[colors.primary]
|
||||
background = '#000000'
|
||||
foreground = '#00ff00'
|
||||
|
||||
[colors.selection]
|
||||
background = '#083905'
|
||||
text = '#ffffff'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#24292e'
|
||||
foreground = '#d1d5da'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#586069'
|
||||
red = '#ea4a5a'
|
||||
green = '#34d058'
|
||||
yellow = '#ffea7f'
|
||||
blue = '#2188ff'
|
||||
magenta = '#b392f0'
|
||||
cyan = '#39c5cf'
|
||||
white = '#d1d5da'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#959da5'
|
||||
red = '#f97583'
|
||||
green = '#85e89d'
|
||||
yellow = '#ffea7f'
|
||||
blue = '#79b8ff'
|
||||
magenta = '#b392f0'
|
||||
cyan = '#56d4dd'
|
||||
white = '#fafbfc'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#f97583'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#0d1117'
|
||||
foreground = '#b3b1ad'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#484f58'
|
||||
red = '#ff7b72'
|
||||
green = '#3fb950'
|
||||
yellow = '#d29922'
|
||||
blue = '#58a6ff'
|
||||
magenta = '#bc8cff'
|
||||
cyan = '#39c5cf'
|
||||
white = '#b1bac4'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#6e7681'
|
||||
red = '#ffa198'
|
||||
green = '#56d364'
|
||||
yellow = '#e3b341'
|
||||
blue = '#79c0ff'
|
||||
magenta = '#d2a8ff'
|
||||
cyan = '#56d4dd'
|
||||
white = '#f0f6fc'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#ffa198'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#0d1117'
|
||||
foreground = '#b3b1ad'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#484f58'
|
||||
red = '#ff7b72'
|
||||
green = '#3fb950'
|
||||
yellow = '#d29922'
|
||||
blue = '#58a6ff'
|
||||
magenta = '#bc8cff'
|
||||
cyan = '#39c5cf'
|
||||
white = '#b1bac4'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#6e7681'
|
||||
red = '#ffa198'
|
||||
green = '#56d364'
|
||||
yellow = '#e3b341'
|
||||
blue = '#79c0ff'
|
||||
magenta = '#d2a8ff'
|
||||
cyan = '#56d4dd'
|
||||
white = '#f0f6fc'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#ffa198'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#22272e'
|
||||
foreground = '#768390'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#545d68'
|
||||
red = '#f47067'
|
||||
green = '#57ab5a'
|
||||
yellow = '#c69026'
|
||||
blue = '#539bf5'
|
||||
magenta = '#b083f0'
|
||||
cyan = '#39c5cf'
|
||||
white = '#909dab'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#636e7b'
|
||||
red = '#ff938a'
|
||||
green = '#6bc46d'
|
||||
yellow = '#daaa3f'
|
||||
blue = '#6cb6ff'
|
||||
magenta = '#dcbdfb'
|
||||
cyan = '#56d4dd'
|
||||
white = '#cdd9e5'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#ff938a'
|
|
@ -0,0 +1,33 @@
|
|||
# (Github Dark High Contrast) Colors for Alacritty
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#0a0c10'
|
||||
foreground = '#f0f3f6'
|
||||
|
||||
# Cursor colors
|
||||
[colors.cursor]
|
||||
text = '#0a0c10'
|
||||
cursor = '#f0f3f6'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#7a828e'
|
||||
red = '#ff9492'
|
||||
green = '#26cd4d'
|
||||
yellow = '#f0b72f'
|
||||
blue = '#71b7ff'
|
||||
magenta = '#cb9eff'
|
||||
cyan = '#39c5cf'
|
||||
white = '#d9dee3'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#9ea7b3'
|
||||
red = '#ffb1af'
|
||||
green = '#4ae168'
|
||||
yellow = '#f7c843'
|
||||
blue = '#91cbff'
|
||||
magenta = '#cb9eff'
|
||||
cyan = '#39c5cf'
|
||||
white = '#d9dee3'
|
|
@ -0,0 +1,33 @@
|
|||
# (Github Dark Tritanopia) Colors for Alacritty
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#0d1117'
|
||||
foreground = '#c9d1d9'
|
||||
|
||||
# Cursor colors
|
||||
[colors.cursor]
|
||||
text = '#0d1117'
|
||||
cursor = '#c9d1d9'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#484f58'
|
||||
red = '#ff7b72'
|
||||
green = '#58a6ff'
|
||||
yellow = '#d29922'
|
||||
blue = '#58a6ff'
|
||||
magenta = '#bc8cff'
|
||||
cyan = '#39c5cf'
|
||||
white = '#b1bac4'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#6e7681'
|
||||
red = '#ffa198'
|
||||
green = '#79c0ff'
|
||||
yellow = '#e3b341'
|
||||
blue = '#79c0ff'
|
||||
magenta = '#bc8cff'
|
||||
cyan = '#39c5cf'
|
||||
white = '#b1bac4'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#ffffff'
|
||||
foreground = '#24292f'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#24292e'
|
||||
red = '#d73a49'
|
||||
green = '#28a745'
|
||||
yellow = '#dbab09'
|
||||
blue = '#0366d6'
|
||||
magenta = '#5a32a3'
|
||||
cyan = '#0598bc'
|
||||
white = '#6a737d'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#959da5'
|
||||
red = '#cb2431'
|
||||
green = '#22863a'
|
||||
yellow = '#b08800'
|
||||
blue = '#005cc5'
|
||||
magenta = '#5a32a3'
|
||||
cyan = '#3192aa'
|
||||
white = '#d1d5da'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#cb2431'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#ffffff'
|
||||
foreground = '#0E1116'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#24292f'
|
||||
red = '#cf222e'
|
||||
green = '#116329'
|
||||
yellow = '#4d2d00'
|
||||
blue = '#0969da'
|
||||
magenta = '#8250df'
|
||||
cyan = '#1b7c83'
|
||||
white = '#6e7781'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#57606a'
|
||||
red = '#a40e26'
|
||||
green = '#1a7f37'
|
||||
yellow = '#633c01'
|
||||
blue = '#218bff'
|
||||
magenta = '#a475f9'
|
||||
cyan = '#3192aa'
|
||||
white = '#8c959f'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#a40e26'
|
|
@ -0,0 +1,36 @@
|
|||
# github Alacritty Colors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#ffffff'
|
||||
foreground = '#0E1116'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#24292f'
|
||||
red = '#cf222e'
|
||||
green = '#116329'
|
||||
yellow = '#4d2d00'
|
||||
blue = '#0969da'
|
||||
magenta = '#8250df'
|
||||
cyan = '#1b7c83'
|
||||
white = '#6e7781'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#57606a'
|
||||
red = '#a40e26'
|
||||
green = '#1a7f37'
|
||||
yellow = '#633c01'
|
||||
blue = '#218bff'
|
||||
magenta = '#a475f9'
|
||||
cyan = '#3192aa'
|
||||
white = '#8c959f'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#d18616'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#a40e26'
|
|
@ -0,0 +1,33 @@
|
|||
# (Github Light High Contrast) Colors for Alacritty
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#ffffff'
|
||||
foreground = '#010409'
|
||||
|
||||
# Cursor colors
|
||||
[colors.cursor]
|
||||
text = '#ffffff'
|
||||
cursor = '#0e1116'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#0e1116'
|
||||
red = '#a0111f'
|
||||
green = '#024c1a'
|
||||
yellow = '#3f2200'
|
||||
blue = '#0349b4'
|
||||
magenta = '#622cbc'
|
||||
cyan = '#1b7c83'
|
||||
white = '#66707b'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#4b535d'
|
||||
red = '#86061d'
|
||||
green = '#055d20'
|
||||
yellow = '#4e2c00'
|
||||
blue = '#1168e3'
|
||||
magenta = '#622cbc'
|
||||
cyan = '#1b7c83'
|
||||
white = '#66707b'
|
|
@ -0,0 +1,33 @@
|
|||
# (Github Light Tritanopia) Colors for Alacritty
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#ffffff'
|
||||
foreground = '#1b1f24'
|
||||
|
||||
# Cursor colors
|
||||
[colors.cursor]
|
||||
text = '#ffffff'
|
||||
cursor = '#24292f'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#24292f'
|
||||
red = '#cf222e'
|
||||
green = '#0550ae'
|
||||
yellow = '#4d2d00'
|
||||
blue = '#0969da'
|
||||
magenta = '#8250df'
|
||||
cyan = '#1b7c83'
|
||||
white = '#6e7781'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#57606a'
|
||||
red = '#a40e26'
|
||||
green = '#0969da'
|
||||
yellow = '#633c01'
|
||||
blue = '#218bff'
|
||||
magenta = '#8250df'
|
||||
cyan = '#1b7c83'
|
||||
white = '#6e7781'
|
|
@ -0,0 +1,30 @@
|
|||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#000000'
|
||||
foreground = '#19a33a'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#122637'
|
||||
cursor = '#14f105'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#282e2a'
|
||||
red = '#70a542'
|
||||
green = '#00ca07'
|
||||
yellow = '#5fde6d'
|
||||
blue = '#5f9d75'
|
||||
magenta = '#678f71'
|
||||
cyan = '#5e8d87'
|
||||
white = '#718070'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#394738'
|
||||
red = '#66cc7b'
|
||||
green = '#03e880'
|
||||
yellow = '#74f0a3'
|
||||
blue = '#81beba'
|
||||
magenta = '#94bb9b'
|
||||
cyan = '#8abeb7'
|
||||
white = '#b2cab6'
|
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
fish_variables
|
|
@ -0,0 +1,131 @@
|
|||
#
|
||||
# AUTO GENERATED BY 'fish-lsp'
|
||||
#
|
||||
# * Any command should generate the completions file
|
||||
#
|
||||
# >_ fish-lsp complete > ~/.config/fish/completions/fish-lsp.fish
|
||||
# >_ fish-lsp complete --fish > ~/.config/fish/completions/fish-lsp.fish
|
||||
# >_ yarn install # from inside the 'fish-lsp'
|
||||
#
|
||||
# * You can test the completions by editing:
|
||||
#
|
||||
# ~/.config/fish/completions/fish-lsp.fish
|
||||
#
|
||||
# or by using the command:
|
||||
#
|
||||
# >_ fish-lsp complete
|
||||
#
|
||||
# to visually check what is wrong
|
||||
#
|
||||
# * For more info, try editing the generated output inside:
|
||||
#
|
||||
# ~/...install_path.../fish-lsp/src/utils/get-lsp-completions.ts
|
||||
#
|
||||
|
||||
|
||||
# Returns exit code of 0 if any command (argv[1..-1]) appears once, ignores flags.
|
||||
function __fish_lsp_using_command
|
||||
set -l commands $argv
|
||||
set -l cmd (commandline -opc)
|
||||
if test (count $cmd) -gt 1
|
||||
set -l command_seen_once 1
|
||||
for c in $cmd[2..-1]
|
||||
switch $c
|
||||
case '-*'
|
||||
continue
|
||||
case $commands
|
||||
# If the command is seen more than once then return 1
|
||||
if test $command_seen_once -eq 1
|
||||
set command_seen_once 0
|
||||
else
|
||||
return 1
|
||||
end
|
||||
case '*'
|
||||
if test $command_seen_once -eq 0
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
return $command_seen_once
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
# disable file completions
|
||||
complete -c fish-lsp -f
|
||||
|
||||
complete -c fish-lsp -n "__fish_use_subcommand" -a "
|
||||
start\t'subcmd to start the lsp using stdin/stdout'
|
||||
logger\t'test the logger by displaying it'
|
||||
info\t'show the build info of fish-lsp'
|
||||
url\t'show a helpful url related to the fish-lsp'
|
||||
complete\t'generate completions file for ~/.config/fish/completions'
|
||||
env\t'generate fish shell env variables to be used by lsp'"
|
||||
|
||||
set __fish_lsp_subcommands start
|
||||
|
||||
# fish_lsp [start] --<TAB>
|
||||
complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -a "
|
||||
--dump\t'dump output and stop server'
|
||||
--enable\t'enable feature'
|
||||
--disable\t'disable feature'"
|
||||
|
||||
# fish-lsp url --<TAB>
|
||||
complete -c fish-lsp -n "__fish_seen_subcommand_from url" -a "
|
||||
--repo 'show git url'
|
||||
--git 'show git url'
|
||||
--npm 'show npm url'
|
||||
--homepage 'show homepage url'
|
||||
--contributions 'show git contributions url'
|
||||
--wiki 'show git wiki url'
|
||||
--issues 'show git issues url'
|
||||
--report 'show git issues url'
|
||||
--discussions 'show git discussions url'
|
||||
--clients-repo 'show git clients-repo url'
|
||||
--sources 'show useful list of sources'"
|
||||
|
||||
# fish-lsp complete <TAB>
|
||||
complete -c fish-lsp -n __fish_use_subcommand -a complete -d 'completion utils for fish-lsp cli'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt features' -l features -d 'show features'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt fish' -l fish -d 'show completion/fish-lsp.fish'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt names' -l names -d 'show feature names of completions'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt toggle' -l toggle -d 'show feature names of completions'
|
||||
|
||||
# fish-lsp info --<TAB>
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt bin' -l bin -d 'show the binary path'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt repo' -l repo -d 'show the repo path'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt time' -l time -d 'show the build-time'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt env' -l env -d 'show the env-variables used'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt lsp-version' -l lsp-version -d 'show the npm package for the lsp-version'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt capabilities' -l capabilities -d 'show the lsp capabilities implemented'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt man-file' -l man-file -d 'show man file path'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt logs-file' -l logs-file -d 'show logs.txt file path'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt more' -l more -d 'show more info'
|
||||
|
||||
# fish-lsp logger --<TAB>
|
||||
complete -c fish-lsp -n __fish_use_subcommand -x -a logger -d 'logger utilities'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s s show' -s s -l show -d 'show the "logs.txt" file'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s c clear' -s c -l clear -d 'clear the "logs.txt" file'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s q quiet' -s q -l quiet -d 'only write to "logs.txt" file'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s d date' -s d -l date -d 'write date to "logs.txt" file'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt config' -l config -d 'show the logger config'
|
||||
|
||||
# print all $fish_lsp_submcommands
|
||||
function _fish_lsp_get_features
|
||||
printf %b\n complete hover rename reference formatting codeAction codeLens folding signature executeCommand inlayHint highlight diagnostic
|
||||
end
|
||||
|
||||
# fish-lsp env --<TAB>
|
||||
complete -c fish-lsp -n __fish_use_subcommand -x -a env -d 'generate fish shell env variables to be used by lsp'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt -s s show; and not __fish_contains_opt -s c create' -s s -l show -d 'show the current fish-lsp env variables'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt -s c create; and not __fish_contains_opt -s s show' -s c -l create -d 'build initial fish-lsp env variables'
|
||||
complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt no-comments' -l no-comments -d 'skip outputting comments'
|
||||
|
||||
# COMPLETION: fish-lsp subcmd <option> [VALUE] (`fish-lsp start --enable ...`)
|
||||
complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -l enable -xa '(_fish_lsp_get_features)'
|
||||
complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -l disable -xa '(_fish_lsp_get_features)'
|
||||
|
||||
# built by the command:
|
||||
# fish-lsp complete ~/.config/fish/completions/fish-lsp.fish
|
|
@ -0,0 +1,7 @@
|
|||
complete --command fisher --exclusive --long help --description "Print help"
|
||||
complete --command fisher --exclusive --long version --description "Print version"
|
||||
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
|
||||
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
|
||||
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
|
||||
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
|
||||
complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"
|
|
@ -0,0 +1,8 @@
|
|||
complete fzf_configure_bindings --no-files
|
||||
complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h"
|
||||
complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory"
|
||||
complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log"
|
||||
complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status"
|
||||
complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history"
|
||||
complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes"
|
||||
complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables"
|
|
@ -0,0 +1,28 @@
|
|||
# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup
|
||||
if not status is-interactive && test "$CI" != true
|
||||
exit
|
||||
end
|
||||
|
||||
# Because of scoping rules, to capture the shell variables exactly as they are, we must read
|
||||
# them before even executing _fzf_search_variables. We use psub to store the
|
||||
# variables' info in temporary files and pass in the filenames as arguments.
|
||||
# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
|
||||
set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
|
||||
|
||||
|
||||
# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
|
||||
fzf_configure_bindings
|
||||
|
||||
# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
|
||||
function _fzf_uninstall --on-event fzf_uninstall
|
||||
_fzf_uninstall_bindings
|
||||
|
||||
set --erase _fzf_search_vars_command
|
||||
functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings
|
||||
complete --erase fzf_configure_bindings
|
||||
|
||||
set_color cyan
|
||||
echo "fzf.fish uninstalled."
|
||||
echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings."
|
||||
set_color normal
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
switch (uname)
|
||||
case FreeBSD NetBSD DragonFly
|
||||
echo Hi Beastie!
|
||||
case Linux
|
||||
#echo Hi Tux!
|
||||
set -x RUSTUP_HOME '/usr/local/share/rustup'
|
||||
case Darwin
|
||||
#echo Hi Hexley!
|
||||
source "$HOME/.cargo/env.fish"
|
||||
case '*'
|
||||
echo Hi, stranger!
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,237 @@
|
|||
switch (uname)
|
||||
case FreeBSD NetBSD DragonFly
|
||||
echo Hi Beastie!
|
||||
case Linux
|
||||
#echo Hi Tux!
|
||||
fish_vi_key_bindings
|
||||
set ID (id -u)
|
||||
# Start tmux
|
||||
if not set -q TMUX; and [ $ID != 0 ]
|
||||
echo "Setting tmux"
|
||||
#set -g TMUX tmux new-session -d -s base
|
||||
#eval $TMUX
|
||||
#tmux attach-session -d -t base
|
||||
eval tmux
|
||||
end
|
||||
|
||||
# PATH
|
||||
# Local PATH
|
||||
fish_add_path -a $HOME/.local/bin
|
||||
|
||||
# Mason PATH
|
||||
fish_add_path -a $HOME/.local/share/nvim/mason/bin
|
||||
|
||||
# sbin PATH
|
||||
fish_add_path -a /sbin
|
||||
fish_add_path -a /usr/sbin
|
||||
|
||||
# Rust
|
||||
fish_add_path -a /usr/local/share/cargo/bin
|
||||
|
||||
# Android
|
||||
fish_add_path -a /usr/share/android-tools
|
||||
|
||||
# rocm
|
||||
fish_add_path -a /opt/rocm/bin
|
||||
|
||||
# Java
|
||||
#fish_add_path -a /usr/local/jdk-21/bin
|
||||
|
||||
# Ltex-LS
|
||||
#fish_add_path -a /usr/local/share/ltex-ls-16.0.0/bin
|
||||
|
||||
# pyenv
|
||||
set -x PYENV_ROOT /usr/share/pyenv
|
||||
fish_add_path -a $PYENV_ROOT/bin
|
||||
pyenv init - fish | source
|
||||
status --is-interactive; and pyenv virtualenv-init - | source
|
||||
|
||||
# Zig
|
||||
fish_add_path -a /usr/share/zig
|
||||
|
||||
|
||||
|
||||
# VARIABLES
|
||||
# For Torch
|
||||
set -gx HSA_OVERRIDE_GFX_VERSION '10.3.0'
|
||||
|
||||
# bat
|
||||
set -x BAT_THEME 'tokyonight_night'
|
||||
|
||||
# Rust
|
||||
set -gx CARGO_HOME '/usr/local/share/cargo'
|
||||
|
||||
# ssh and gpg
|
||||
set -x GPG_TTY (tty)
|
||||
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
|
||||
gpgconf --launch gpg-agent
|
||||
gpg-connect-agent updatestartuptty /bye > /dev/null
|
||||
|
||||
# Editor
|
||||
set -gx EDITOR 'nvim'
|
||||
|
||||
# Manpager
|
||||
#set -gx PAGER 'nvim +Man!'
|
||||
|
||||
# Term for ssh
|
||||
#set -gx TERM 'xterm-256color'
|
||||
|
||||
# fzf
|
||||
set -x FZF_CTRL_T_OPTS "--preview 'bat -n --color=always --line-range :500 {}'"
|
||||
set -x FZF_ALT_C_OPTS "--preview 'eza --tree --color=always {} | head 200'"
|
||||
|
||||
|
||||
# ALIAS
|
||||
# convinience
|
||||
alias doas="sudo"
|
||||
|
||||
# Neovim
|
||||
alias vi="nvim"
|
||||
alias vim="nvim"
|
||||
|
||||
# cat
|
||||
alias cat="bat"
|
||||
|
||||
# ls
|
||||
alias ls="eza --color=always --long --git --icons=always --group"
|
||||
|
||||
# mutt
|
||||
#alias mutt='neomutt'
|
||||
|
||||
# rsync
|
||||
alias rsync='rsync -h -v -r -P -p -t --stats'
|
||||
|
||||
# wget folder
|
||||
alias wget_f='wget -r -np -R "index.html*"'
|
||||
|
||||
# btop
|
||||
alias top='btop'
|
||||
|
||||
# fzf
|
||||
fzf --fish | source
|
||||
|
||||
# git signed
|
||||
function git --wraps git
|
||||
switch $argv[1]
|
||||
case commit
|
||||
/usr/bin/git commit -S
|
||||
case tag
|
||||
/usr/bin/git tag -S
|
||||
case '*'
|
||||
/usr/bin/git $argv
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
case Darwin
|
||||
#echo Hi Hexley!
|
||||
fish_vi_key_bindings
|
||||
set ID (id -u)
|
||||
## Start tmux
|
||||
#if not set -q TMUX; and [ $ID != 0 ]
|
||||
# echo "Setting tmux"
|
||||
# set -g TMUX tmux new-session -d -s base
|
||||
# eval $TMUX
|
||||
# tmux attach-session -d -t base
|
||||
#end
|
||||
|
||||
# PATH
|
||||
# Homebrew
|
||||
fish_add_path -a /opt/homebrew/bin
|
||||
fish_add_path -a /opt/homebrew/sbin
|
||||
|
||||
# Local PATH
|
||||
fish_add_path -a $HOME/.local/bin
|
||||
|
||||
# Mason PATH
|
||||
fish_add_path -a $HOME/.local/share/nvim/mason/bin
|
||||
|
||||
# Java
|
||||
fish_add_path -a /opt/homebrew/Cellar/openjdk/23.0.1/bin
|
||||
|
||||
# Ruby
|
||||
fish_add_path -a /opt/homebrew/opt/ruby/bin
|
||||
fish_add_path -a /opt/homebrew/lib/ruby/gems/3.4.0/bin
|
||||
|
||||
# Zig
|
||||
fish_add_path -a /opt/zig
|
||||
|
||||
# pyenv
|
||||
set -x PYENV_ROOT "$HOME/.pyenv"
|
||||
fish_add_path -a $PYENV_ROOT/bin
|
||||
pyenv init - | source
|
||||
status --is-interactive; and pyenv virtualenv-init - | source
|
||||
|
||||
# VARIABLES
|
||||
if [ $ID != 0 ]
|
||||
# ssh and gpg
|
||||
set -x GPG_TTY (tty)
|
||||
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
|
||||
gpgconf --launch gpg-agent
|
||||
gpg-connect-agent updatestartuptty /bye > /dev/null
|
||||
end
|
||||
|
||||
# Editor
|
||||
set -x EDITOR 'nvim'
|
||||
|
||||
# Manpager
|
||||
set -x PAGER 'nvim +Man!'
|
||||
|
||||
# Term for ssh
|
||||
#export TERM='xterm-256color'
|
||||
|
||||
# Homebrew
|
||||
set -x HOMEBREW_NO_AUTO_UPDATE 1
|
||||
set -x HOMEBREW_NO_ENV_HINTS 1
|
||||
|
||||
# DBUS for zathura
|
||||
#export DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/(id -u)
|
||||
#export DBUS_SESSION_BUS_ADDRESS='unix:path='$DBUS_LAUNCHD_SESSION_BUS_SOCKET
|
||||
#if pgrep -x dbus-daemon &> /dev/null
|
||||
# printf (_ "%sdbus-daemon%s is running\n") (set_color red) (set_color normal)
|
||||
#else
|
||||
# #echo "dbus-daemon is not running"
|
||||
# dbus-daemon --fork --session --address=$DBUS_SESSION_BUS_ADDRESS
|
||||
#end
|
||||
|
||||
|
||||
# ALIAS
|
||||
# convinience
|
||||
alias doas='sudo'
|
||||
|
||||
# ls
|
||||
alias ls='colorls'
|
||||
|
||||
# neovim
|
||||
alias vi='nvim'
|
||||
alias vim='nvim'
|
||||
|
||||
# mutt
|
||||
#alias mutt='neomutt'
|
||||
|
||||
# rsync
|
||||
alias rsync='rsync -h -v -r -P -p -t --stats'
|
||||
|
||||
# wget folder
|
||||
alias wget_f='wget -r -np -R "index.html*"'
|
||||
|
||||
# btop
|
||||
alias top='btop'
|
||||
|
||||
# git signed
|
||||
function git --wraps git
|
||||
switch $argv[1]
|
||||
case commit
|
||||
/usr/bin/git commit -S
|
||||
case tag
|
||||
/usr/bin/git tag -S
|
||||
case '*'
|
||||
/usr/bin/git $argv
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
case '*'
|
||||
echo Hi, stranger!
|
||||
end
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
jorgebucaran/fisher
|
||||
patrickf1/fzf.fish
|
|
@ -0,0 +1,43 @@
|
|||
function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings."
|
||||
echo "\
|
||||
USAGE:
|
||||
fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...]
|
||||
|
||||
DESCRIPTION
|
||||
fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it
|
||||
previously installed. It installs bindings for both default and insert modes. fzf.fish executes
|
||||
it without options on fish startup to install the out-of-the-box key bindings.
|
||||
|
||||
By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding
|
||||
can be configured using a namesake corresponding option:
|
||||
COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION
|
||||
Search Directory | Ctrl+Alt+F (F for file) | --directory
|
||||
Search Git Log | Ctrl+Alt+L (L for log) | --git_log
|
||||
Search Git Status | Ctrl+Alt+S (S for status) | --git_status
|
||||
Search History | Ctrl+R (R for reverse) | --history
|
||||
Search Processes | Ctrl+Alt+P (P for process) | --processes
|
||||
Search Variables | Ctrl+V (V for variable) | --variables
|
||||
Override a command's binding by specifying its corresponding option with the desired key
|
||||
sequence. Disable a command's binding by specifying its corresponding option with no value.
|
||||
|
||||
Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly
|
||||
executed multiple times. Once the desired fzf_configure_bindings command has been found, add it
|
||||
to your config.fish in order to persist the customized bindings.
|
||||
|
||||
In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an
|
||||
equals sign between an option's name and value. However, it does not validate key sequences.
|
||||
|
||||
Pass -h or --help to print this help message and exit.
|
||||
|
||||
EXAMPLES
|
||||
Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V
|
||||
\$ fzf_configure_bindings --directory=\cf --variables=\e\cv
|
||||
Default bindings but disable Search History
|
||||
\$ fzf_configure_bindings --history=
|
||||
An agglomeration of different options
|
||||
\$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes=
|
||||
|
||||
SEE Also
|
||||
To learn more about fish key bindings, see bind(1) and fish_key_reader(1).
|
||||
"
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
# helper function for _fzf_search_variables
|
||||
function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output."
|
||||
# Extract only the lines about the variable, all of which begin with either
|
||||
# $variable_name: ...or... $variable_name[
|
||||
string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output |
|
||||
|
||||
# Strip the variable name prefix, including ": " for scope info lines
|
||||
string replace --regex "^\\\$$variable_name(?:: )?" '' |
|
||||
|
||||
# Distill the lines of values, replacing...
|
||||
# [1]: |value|
|
||||
# ...with...
|
||||
# [1] value
|
||||
string replace --regex ": \|(.*)\|" ' $1'
|
||||
end
|
|
@ -0,0 +1,49 @@
|
|||
# helper for _fzf_search_git_status
|
||||
# arg should be a line from git status --short, e.g.
|
||||
# MM functions/_fzf_preview_changed_file.fish
|
||||
# D README.md
|
||||
# R LICENSE -> "New License"
|
||||
function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file."
|
||||
# remove quotes because they'll be interpreted literally by git diff
|
||||
# no need to requote when referencing $path because fish does not perform word splitting
|
||||
# https://fishshell.com/docs/current/fish_for_bash_users.html
|
||||
set -f path (string unescape (string sub --start 4 $path_status))
|
||||
# first letter of short format shows index, second letter shows working tree
|
||||
# https://git-scm.com/docs/git-status/2.35.0#_short_format
|
||||
set -f index_status (string sub --length 1 $path_status)
|
||||
set -f working_tree_status (string sub --start 2 --length 1 $path_status)
|
||||
|
||||
set -f diff_opts --color=always
|
||||
|
||||
if test $index_status = '?'
|
||||
_fzf_report_diff_type Untracked
|
||||
_fzf_preview_file $path
|
||||
else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU
|
||||
# Unmerged statuses taken directly from git status help's short format table
|
||||
# Unmerged statuses are mutually exclusive with other statuses, so if we see
|
||||
# these, then safe to assume the path is unmerged
|
||||
_fzf_report_diff_type Unmerged
|
||||
git diff $diff_opts -- $path
|
||||
else
|
||||
if test $index_status != ' '
|
||||
_fzf_report_diff_type Staged
|
||||
|
||||
# renames are only detected in the index, never working tree, so only need to test for it here
|
||||
# https://stackoverflow.com/questions/73954214
|
||||
if test $index_status = R
|
||||
# diff the post-rename path with the original path, otherwise the diff will show the entire file as being added
|
||||
set -f orig_and_new_path (string split --max 1 -- ' -> ' $path)
|
||||
git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2]
|
||||
# path currently has the form of "original -> current", so we need to correct it before it's used below
|
||||
set path $orig_and_new_path[2]
|
||||
else
|
||||
git diff --staged $diff_opts -- $path
|
||||
end
|
||||
end
|
||||
|
||||
if test $working_tree_status != ' '
|
||||
_fzf_report_diff_type Unstaged
|
||||
git diff $diff_opts -- $path
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,43 @@
|
|||
# helper function for _fzf_search_directory and _fzf_search_git_status
|
||||
function _fzf_preview_file --description "Print a preview for the given file based on its file type."
|
||||
# because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file
|
||||
# as one argument, we collect all the arguments into one single variable and treat that as the path
|
||||
set -f file_path $argv
|
||||
|
||||
if test -L "$file_path" # symlink
|
||||
# notify user and recurse on the target of the symlink, which can be any of these file types
|
||||
set -l target_path (realpath "$file_path")
|
||||
|
||||
set_color yellow
|
||||
echo "'$file_path' is a symlink to '$target_path'."
|
||||
set_color normal
|
||||
|
||||
_fzf_preview_file "$target_path"
|
||||
else if test -f "$file_path" # regular file
|
||||
if set --query fzf_preview_file_cmd
|
||||
# need to escape quotes to make sure eval receives file_path as a single arg
|
||||
eval "$fzf_preview_file_cmd '$file_path'"
|
||||
else
|
||||
bat --style=numbers --color=always "$file_path"
|
||||
end
|
||||
else if test -d "$file_path" # directory
|
||||
if set --query fzf_preview_dir_cmd
|
||||
# see above
|
||||
eval "$fzf_preview_dir_cmd '$file_path'"
|
||||
else
|
||||
# -A list hidden files as well, except for . and ..
|
||||
# -F helps classify files by appending symbols after the file name
|
||||
command ls -A -F "$file_path"
|
||||
end
|
||||
else if test -c "$file_path"
|
||||
_fzf_report_file_type "$file_path" "character device file"
|
||||
else if test -b "$file_path"
|
||||
_fzf_report_file_type "$file_path" "block device file"
|
||||
else if test -S "$file_path"
|
||||
_fzf_report_file_type "$file_path" socket
|
||||
else if test -p "$file_path"
|
||||
_fzf_report_file_type "$file_path" "named pipe"
|
||||
else
|
||||
echo "$file_path doesn't exist." >&2
|
||||
end
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
# helper for _fzf_preview_changed_file
|
||||
# prints out something like
|
||||
# ╭────────╮
|
||||
# │ Staged │
|
||||
# ╰────────╯
|
||||
function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch."
|
||||
# number of "-" to draw is the length of the string to box + 2 for padding
|
||||
set -f repeat_count (math 2 + (string length $diff_type))
|
||||
set -f line (string repeat --count $repeat_count ─)
|
||||
set -f top_border ╭$line╮
|
||||
set -f btm_border ╰$line╯
|
||||
|
||||
set_color yellow
|
||||
echo $top_border
|
||||
echo "│ $diff_type │"
|
||||
echo $btm_border
|
||||
set_color normal
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
# helper function for _fzf_preview_file
|
||||
function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file."
|
||||
set_color red
|
||||
echo "Cannot preview '$file_path': it is a $file_type."
|
||||
set_color normal
|
||||
end
|
|
@ -0,0 +1,33 @@
|
|||
function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths."
|
||||
# Directly use fd binary to avoid output buffering delay caused by a fd alias, if any.
|
||||
# Debian-based distros install fd as fdfind and the fd package is something else, so
|
||||
# check for fdfind first. Fall back to "fd" for a clear error message.
|
||||
set -f fd_cmd (command -v fdfind || command -v fd || echo "fd")
|
||||
set -f --append fd_cmd --color=always $fzf_fd_opts
|
||||
|
||||
set -f fzf_arguments --multi --ansi $fzf_directory_opts
|
||||
set -f token (commandline --current-token)
|
||||
# expand any variables or leading tilde (~) in the token
|
||||
set -f expanded_token (eval echo -- $token)
|
||||
# unescape token because it's already quoted so backslashes will mess up the path
|
||||
set -f unescaped_exp_token (string unescape -- $expanded_token)
|
||||
|
||||
# If the current token is a directory and has a trailing slash,
|
||||
# then use it as fd's base directory.
|
||||
if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token"
|
||||
set --append fd_cmd --base-directory=$unescaped_exp_token
|
||||
# use the directory name as fzf's prompt to indicate the search is limited to that directory
|
||||
set --prepend fzf_arguments --prompt="Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}"
|
||||
set -f file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
|
||||
else
|
||||
set --prepend fzf_arguments --prompt="Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}'
|
||||
set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
|
||||
end
|
||||
|
||||
|
||||
if test $status -eq 0
|
||||
commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ')
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
|
@ -0,0 +1,36 @@
|
|||
function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash."
|
||||
if not git rev-parse --git-dir >/dev/null 2>&1
|
||||
echo '_fzf_search_git_log: Not in a git repository.' >&2
|
||||
else
|
||||
if not set --query fzf_git_log_format
|
||||
# %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below
|
||||
set -f fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)'
|
||||
end
|
||||
|
||||
set -f preview_cmd 'git show --color=always --stat --patch {1}'
|
||||
if set --query fzf_diff_highlighter
|
||||
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
|
||||
end
|
||||
|
||||
set -f selected_log_lines (
|
||||
git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \
|
||||
_fzf_wrapper --ansi \
|
||||
--multi \
|
||||
--scheme=history \
|
||||
--prompt="Git Log> " \
|
||||
--preview=$preview_cmd \
|
||||
--query=(commandline --current-token) \
|
||||
$fzf_git_log_opts
|
||||
)
|
||||
if test $status -eq 0
|
||||
for line in $selected_log_lines
|
||||
set -f abbreviated_commit_hash (string split --field 1 " " $line)
|
||||
set -f full_commit_hash (git rev-parse $abbreviated_commit_hash)
|
||||
set -f --append commit_hashes $full_commit_hash
|
||||
end
|
||||
commandline --current-token --replace (string join ' ' $commit_hashes)
|
||||
end
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
|
@ -0,0 +1,41 @@
|
|||
function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths."
|
||||
if not git rev-parse --git-dir >/dev/null 2>&1
|
||||
echo '_fzf_search_git_status: Not in a git repository.' >&2
|
||||
else
|
||||
set -f preview_cmd '_fzf_preview_changed_file {}'
|
||||
if set --query fzf_diff_highlighter
|
||||
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
|
||||
end
|
||||
|
||||
set -f selected_paths (
|
||||
# Pass configuration color.status=always to force status to use colors even though output is sent to a pipe
|
||||
git -c color.status=always status --short |
|
||||
_fzf_wrapper --ansi \
|
||||
--multi \
|
||||
--prompt="Git Status> " \
|
||||
--query=(commandline --current-token) \
|
||||
--preview=$preview_cmd \
|
||||
--nth="2.." \
|
||||
$fzf_git_status_opts
|
||||
)
|
||||
if test $status -eq 0
|
||||
# git status --short automatically escapes the paths of most files for us so not going to bother trying to handle
|
||||
# the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping")
|
||||
set -f cleaned_paths
|
||||
|
||||
for path in $selected_paths
|
||||
if test (string sub --length 1 $path) = R
|
||||
# path has been renamed and looks like "R LICENSE -> LICENSE.md"
|
||||
# extract the path to use from after the arrow
|
||||
set --append cleaned_paths (string split -- "-> " $path)[-1]
|
||||
else
|
||||
set --append cleaned_paths (string sub --start=4 $path)
|
||||
end
|
||||
end
|
||||
|
||||
commandline --current-token --replace -- (string join ' ' $cleaned_paths)
|
||||
end
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
|
@ -0,0 +1,39 @@
|
|||
function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
|
||||
# history merge incorporates history changes from other fish sessions
|
||||
# it errors out if called in private mode
|
||||
if test -z "$fish_private_mode"
|
||||
builtin history merge
|
||||
end
|
||||
|
||||
if not set --query fzf_history_time_format
|
||||
# Reference https://devhints.io/strftime to understand strftime format symbols
|
||||
set -f fzf_history_time_format "%m-%d %H:%M:%S"
|
||||
end
|
||||
|
||||
# Delinate time from command in history entries using the vertical box drawing char (U+2502).
|
||||
# Then, to get raw command from history entries, delete everything up to it. The ? on regex is
|
||||
# necessary to make regex non-greedy so it won't match into commands containing the char.
|
||||
set -f time_prefix_regex '^.*? │ '
|
||||
# Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line
|
||||
set -f commands_selected (
|
||||
builtin history --null --show-time="$fzf_history_time_format │ " |
|
||||
_fzf_wrapper --read0 \
|
||||
--print0 \
|
||||
--multi \
|
||||
--scheme=history \
|
||||
--prompt="History> " \
|
||||
--query=(commandline) \
|
||||
--preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \
|
||||
--preview-window="bottom:3:wrap" \
|
||||
$fzf_history_opts |
|
||||
string split0 |
|
||||
# remove timestamps from commands selected
|
||||
string replace --regex $time_prefix_regex ''
|
||||
)
|
||||
|
||||
if test $status -eq 0
|
||||
commandline --replace -- $commands_selected
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
|
@ -0,0 +1,32 @@
|
|||
function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process."
|
||||
# Directly use ps command because it is often aliased to a different command entirely
|
||||
# or with options that dirty the search results and preview output
|
||||
set -f ps_cmd (command -v ps || echo "ps")
|
||||
# use all caps to be consistent with ps default format
|
||||
# snake_case because ps doesn't seem to allow spaces in the field names
|
||||
set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command')
|
||||
set -f processes_selected (
|
||||
$ps_cmd -A -opid,command | \
|
||||
_fzf_wrapper --multi \
|
||||
--prompt="Processes> " \
|
||||
--query (commandline --current-token) \
|
||||
--ansi \
|
||||
# first line outputted by ps is a header, so we need to mark it as so
|
||||
--header-lines=1 \
|
||||
# ps uses exit code 1 if the process was not found, in which case show an message explaining so
|
||||
--preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \
|
||||
--preview-window="bottom:4:wrap" \
|
||||
$fzf_processes_opts
|
||||
)
|
||||
|
||||
if test $status -eq 0
|
||||
for process in $processes_selected
|
||||
set -f --append pids_selected (string split --no-empty --field=1 -- " " $process)
|
||||
end
|
||||
|
||||
# string join to replace the newlines outputted by string split with spaces
|
||||
commandline --current-token --replace -- (string join ' ' $pids_selected)
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
|
@ -0,0 +1,47 @@
|
|||
# This function expects the following two arguments:
|
||||
# argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables
|
||||
# argument 2 = output of (set --names | psub), i.e. a file with all variable names
|
||||
function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable."
|
||||
if test -z "$set_names_output"
|
||||
printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2
|
||||
|
||||
commandline --function repaint
|
||||
return 22 # 22 means invalid argument in POSIX
|
||||
end
|
||||
|
||||
# Exclude the history variable from being piped into fzf because
|
||||
# 1. it's not included in $set_names_output
|
||||
# 2. it tends to be a very large value => increases computation time
|
||||
# 3._fzf_search_history is a much better way to examine history anyway
|
||||
set -f all_variable_names (string match --invert history <$set_names_output)
|
||||
|
||||
set -f current_token (commandline --current-token)
|
||||
# Use the current token to pre-populate fzf's query. If the current token begins
|
||||
# with a $, remove it from the query so that it will better match the variable names
|
||||
set -f cleaned_curr_token (string replace -- '$' '' $current_token)
|
||||
|
||||
set -f variable_names_selected (
|
||||
printf '%s\n' $all_variable_names |
|
||||
_fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \
|
||||
--prompt="Variables> " \
|
||||
--preview-window="wrap" \
|
||||
--multi \
|
||||
--query=$cleaned_curr_token \
|
||||
$fzf_variables_opts
|
||||
)
|
||||
|
||||
if test $status -eq 0
|
||||
# If the current token begins with a $, do not overwrite the $ when
|
||||
# replacing the current token with the selected variable.
|
||||
# Uses brace expansion to prepend $ to each variable name.
|
||||
commandline --current-token --replace (
|
||||
if string match --quiet -- '$*' $current_token
|
||||
string join " " \${$variable_names_selected}
|
||||
else
|
||||
string join " " $variable_names_selected
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
|
@ -0,0 +1,21 @@
|
|||
function _fzf_wrapper --description "Prepares some environment variables before executing fzf."
|
||||
# Make sure fzf uses fish to execute preview commands, some of which
|
||||
# are autoloaded fish functions so don't exist in other shells.
|
||||
# Use --function so that it doesn't clobber SHELL outside this function.
|
||||
set -f --export SHELL (command --search fish)
|
||||
|
||||
# If neither FZF_DEFAULT_OPTS nor FZF_DEFAULT_OPTS_FILE are set, then set some sane defaults.
|
||||
# See https://github.com/junegunn/fzf#environment-variables
|
||||
set --query FZF_DEFAULT_OPTS FZF_DEFAULT_OPTS_FILE
|
||||
if test $status -eq 2
|
||||
# cycle allows jumping between the first and last results, making scrolling faster
|
||||
# layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env
|
||||
# border shows where the fzf window begins and ends
|
||||
# height=90% leaves space to see the current command and some scrollback, maintaining context of work
|
||||
# preview-window=wrap wraps long lines in the preview window, making reading easier
|
||||
# marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >)
|
||||
set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"'
|
||||
end
|
||||
|
||||
fzf $argv
|
||||
end
|
|
@ -0,0 +1,21 @@
|
|||
function fish_greeting
|
||||
if not set -q fish_greeting
|
||||
set -l line1 (printf (_ 'Welcome %sEduardo%s, remember to drink water!') (set_color yellow) (set_color normal))
|
||||
set -g fish_greeting "$line1"
|
||||
end
|
||||
|
||||
if set -q fish_private_mode
|
||||
set -l line (_ "fish is running in private mode, history will not be persisted.")
|
||||
if set -q fish_greeting[1]
|
||||
set -g fish_greeting $fish_greeting\n$line
|
||||
else
|
||||
set -g fish_greeting $line
|
||||
end
|
||||
end
|
||||
|
||||
# The greeting used to be skipped when fish_greeting was empty (not just undefined)
|
||||
# Keep it that way to not print superfluous newlines on old configuration
|
||||
test -n "$fish_greeting"
|
||||
and echo $fish_greeting
|
||||
end
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
function fisher --argument-names cmd --description "A plugin manager for Fish"
|
||||
set --query fisher_path || set --local fisher_path $__fish_config_dir
|
||||
set --local fisher_version 4.4.5
|
||||
set --local fish_plugins $__fish_config_dir/fish_plugins
|
||||
|
||||
switch "$cmd"
|
||||
case -v --version
|
||||
echo "fisher, version $fisher_version"
|
||||
case "" -h --help
|
||||
echo "Usage: fisher install <plugins...> Install plugins"
|
||||
echo " fisher remove <plugins...> Remove installed plugins"
|
||||
echo " fisher update <plugins...> Update installed plugins"
|
||||
echo " fisher update Update all installed plugins"
|
||||
echo " fisher list [<regex>] List installed plugins matching regex"
|
||||
echo "Options:"
|
||||
echo " -v, --version Print version"
|
||||
echo " -h, --help Print this help message"
|
||||
echo "Variables:"
|
||||
echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~
|
||||
case ls list
|
||||
string match --entire --regex -- "$argv[2]" $_fisher_plugins
|
||||
case install update remove
|
||||
isatty || read --local --null --array stdin && set --append argv $stdin
|
||||
|
||||
set --local install_plugins
|
||||
set --local update_plugins
|
||||
set --local remove_plugins
|
||||
set --local arg_plugins $argv[2..-1]
|
||||
set --local old_plugins $_fisher_plugins
|
||||
set --local new_plugins
|
||||
|
||||
test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins | string replace -- \~ ~)
|
||||
|
||||
if ! set --query argv[2]
|
||||
if test "$cmd" != update
|
||||
echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1
|
||||
else if ! set --query file_plugins
|
||||
echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
|
||||
end
|
||||
set arg_plugins $file_plugins
|
||||
end
|
||||
|
||||
for plugin in $arg_plugins
|
||||
set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin)
|
||||
contains -- "$plugin" $new_plugins || set --append new_plugins $plugin
|
||||
end
|
||||
|
||||
if set --query argv[2]
|
||||
for plugin in $new_plugins
|
||||
if contains -- "$plugin" $old_plugins
|
||||
test "$cmd" = remove &&
|
||||
set --append remove_plugins $plugin ||
|
||||
set --append update_plugins $plugin
|
||||
else if test "$cmd" = install
|
||||
set --append install_plugins $plugin
|
||||
else
|
||||
echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1
|
||||
end
|
||||
end
|
||||
else
|
||||
for plugin in $new_plugins
|
||||
contains -- "$plugin" $old_plugins &&
|
||||
set --append update_plugins $plugin ||
|
||||
set --append install_plugins $plugin
|
||||
end
|
||||
|
||||
for plugin in $old_plugins
|
||||
contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin
|
||||
end
|
||||
end
|
||||
|
||||
set --local pid_list
|
||||
set --local source_plugins
|
||||
set --local fetch_plugins $update_plugins $install_plugins
|
||||
set --local fish_path (status fish-path)
|
||||
|
||||
echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal)
|
||||
|
||||
for plugin in $fetch_plugins
|
||||
set --local source (command mktemp -d)
|
||||
set --append source_plugins $source
|
||||
|
||||
command mkdir -p $source/{completions,conf.d,themes,functions}
|
||||
|
||||
$fish_path --command "
|
||||
if test -e $plugin
|
||||
command cp -Rf $plugin/* $source
|
||||
else
|
||||
set temp (command mktemp -d)
|
||||
set repo (string split -- \@ $plugin) || set repo[2] HEAD
|
||||
|
||||
if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1])
|
||||
set name (string split -- / \$path)[-1]
|
||||
set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz
|
||||
else
|
||||
set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2]
|
||||
end
|
||||
|
||||
echo Fetching (set_color --underline)\$url(set_color normal)
|
||||
|
||||
if command curl -q --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null
|
||||
command cp -Rf \$temp/*/* $source
|
||||
else
|
||||
echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2
|
||||
command rm -rf $source
|
||||
end
|
||||
|
||||
command rm -rf \$temp
|
||||
end
|
||||
|
||||
set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files
|
||||
" &
|
||||
|
||||
set --append pid_list (jobs --last --pid)
|
||||
end
|
||||
|
||||
wait $pid_list 2>/dev/null
|
||||
|
||||
for plugin in $fetch_plugins
|
||||
if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
|
||||
if set --local index (contains --index -- "$plugin" $install_plugins)
|
||||
set --erase install_plugins[$index]
|
||||
else
|
||||
set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for plugin in $update_plugins $remove_plugins
|
||||
if set --local index (contains --index -- "$plugin" $_fisher_plugins)
|
||||
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
|
||||
|
||||
if contains -- "$plugin" $remove_plugins
|
||||
for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var)
|
||||
emit {$name}_uninstall
|
||||
end
|
||||
printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
|
||||
set --erase _fisher_plugins[$index]
|
||||
end
|
||||
|
||||
command rm -rf (string replace -- \~ ~ $$plugin_files_var)
|
||||
|
||||
functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var)
|
||||
|
||||
for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var)
|
||||
complete --erase --command $name
|
||||
end
|
||||
|
||||
set --erase $plugin_files_var
|
||||
end
|
||||
end
|
||||
|
||||
if set --query update_plugins[1] || set --query install_plugins[1]
|
||||
command mkdir -p $fisher_path/{functions,themes,conf.d,completions}
|
||||
end
|
||||
|
||||
for plugin in $update_plugins $install_plugins
|
||||
set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)]
|
||||
set --local files $source/{functions,themes,conf.d,completions}/*
|
||||
|
||||
if set --local index (contains --index -- $plugin $install_plugins)
|
||||
set --local user_files $fisher_path/{functions,themes,conf.d,completions}/*
|
||||
set --local conflict_files
|
||||
|
||||
for file in (string replace -- $source/ $fisher_path/ $files)
|
||||
contains -- $file $user_files && set --append conflict_files $file
|
||||
end
|
||||
|
||||
if set --query conflict_files[1] && set --erase install_plugins[$index]
|
||||
echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
||||
for file in (string replace -- $source/ "" $files)
|
||||
command cp -RLf $source/$file $fisher_path/$file
|
||||
end
|
||||
|
||||
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
|
||||
|
||||
set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~)
|
||||
|
||||
contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin
|
||||
contains -- $plugin $install_plugins && set --local event install || set --local event update
|
||||
|
||||
printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
|
||||
|
||||
for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~)
|
||||
source $file
|
||||
if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file)
|
||||
emit {$name}_$event
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
command rm -rf $source_plugins
|
||||
|
||||
if set --query _fisher_plugins[1]
|
||||
set --local commit_plugins
|
||||
|
||||
for plugin in $file_plugins
|
||||
contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin
|
||||
end
|
||||
|
||||
for plugin in $_fisher_plugins
|
||||
contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin
|
||||
end
|
||||
|
||||
string replace --regex -- $HOME \~ $commit_plugins >$fish_plugins
|
||||
else
|
||||
set --erase _fisher_plugins
|
||||
command rm -f $fish_plugins
|
||||
end
|
||||
|
||||
set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
|
||||
|
||||
test "$total" != "0 0 0" && echo (string join ", " (
|
||||
test $total[1] = 0 || echo "Installed $total[1]") (
|
||||
test $total[2] = 0 || echo "Updated $total[2]") (
|
||||
test $total[3] = 0 || echo "Removed $total[3]")
|
||||
) plugin/s
|
||||
case \*
|
||||
echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1
|
||||
end
|
||||
end
|
||||
|
||||
if ! set --query _fisher_upgraded_to_4_4
|
||||
set --universal _fisher_upgraded_to_4_4
|
||||
if functions --query _fisher_list
|
||||
set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share
|
||||
command rm -rf $XDG_DATA_HOME/fisher
|
||||
functions --erase _fisher_{list,plugin_parse}
|
||||
fisher update >/dev/null 2>/dev/null
|
||||
else
|
||||
for var in (set --names | string match --entire --regex '^_fisher_.+_files$')
|
||||
set $var (string replace -- ~ \~ $$var)
|
||||
end
|
||||
functions --erase _fisher_fish_postexec
|
||||
end
|
||||
end
|
|
@ -0,0 +1,46 @@
|
|||
# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect
|
||||
# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1
|
||||
function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options."
|
||||
# no need to install bindings if not in interactive mode or running tests
|
||||
status is-interactive || test "$CI" = true; or return
|
||||
|
||||
set -f options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'processes=?' 'variables=?'
|
||||
argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null
|
||||
if test $status -ne 0
|
||||
echo "Invalid option or a positional argument was provided." >&2
|
||||
_fzf_configure_bindings_help
|
||||
return 22
|
||||
else if set --query _flag_help
|
||||
_fzf_configure_bindings_help
|
||||
return
|
||||
else
|
||||
# Initialize with default key sequences and then override or disable them based on flags
|
||||
# index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = processes, 6 = variables
|
||||
set -f key_sequences \e\cf \e\cl \e\cs \cr \e\cp \cv # \c = control, \e = escape
|
||||
set --query _flag_directory && set key_sequences[1] "$_flag_directory"
|
||||
set --query _flag_git_log && set key_sequences[2] "$_flag_git_log"
|
||||
set --query _flag_git_status && set key_sequences[3] "$_flag_git_status"
|
||||
set --query _flag_history && set key_sequences[4] "$_flag_history"
|
||||
set --query _flag_processes && set key_sequences[5] "$_flag_processes"
|
||||
set --query _flag_variables && set key_sequences[6] "$_flag_variables"
|
||||
|
||||
# If fzf bindings already exists, uninstall it first for a clean slate
|
||||
if functions --query _fzf_uninstall_bindings
|
||||
_fzf_uninstall_bindings
|
||||
end
|
||||
|
||||
for mode in default insert
|
||||
test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory
|
||||
test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log
|
||||
test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status
|
||||
test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history
|
||||
test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] _fzf_search_processes
|
||||
test -n $key_sequences[6] && bind --mode $mode $key_sequences[6] "$_fzf_search_vars_command"
|
||||
end
|
||||
|
||||
function _fzf_uninstall_bindings --inherit-variable key_sequences
|
||||
bind --erase -- $key_sequences
|
||||
bind --erase --mode insert -- $key_sequences
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,108 @@
|
|||
font-family = Terminess Nerd Font
|
||||
font-size = 18
|
||||
font-thicken = false
|
||||
theme = Homebrew
|
||||
#theme = Apple Classic
|
||||
## background = #282c34
|
||||
#background = #444445
|
||||
#foreground = #ffffff
|
||||
#minimum-contrast = 1
|
||||
## Black
|
||||
#palette = 0=#000000
|
||||
#palette = 8=#666666
|
||||
## Red
|
||||
#palette = 1=#990000
|
||||
#palette = 9=#e50000
|
||||
## Green
|
||||
#palette = 2=#00a600
|
||||
#palette = 10=#00d900
|
||||
## Yellow
|
||||
#palette = 3=#999900
|
||||
#palette = 11=#e5e500
|
||||
## Blue
|
||||
##palette = 4=#0000b2
|
||||
#palette = 4=#053de6
|
||||
#palette = 12=#0000ff
|
||||
## Purple
|
||||
#palette = 5=#b200b2
|
||||
#palette = 13=#e500e5
|
||||
## Aqua
|
||||
#palette = 6=#00a6b2
|
||||
#palette = 14=#00e5e5
|
||||
## White
|
||||
#palette = 7=#bfbfbf
|
||||
#palette = 15=#e5e5e5
|
||||
cursor-color =
|
||||
cursor-invert-fg-bg = false
|
||||
cursor-opacity = 1
|
||||
cursor-style = block
|
||||
cursor-style-blink =
|
||||
cursor-click-to-move = true
|
||||
mouse-hide-while-typing = false
|
||||
mouse-shift-capture = false
|
||||
background-opacity = 1
|
||||
unfocused-split-opacity = 0.7
|
||||
scrollback-limit = 10000000
|
||||
link-url = true
|
||||
fullscreen = false
|
||||
window-padding-x = 2
|
||||
window-padding-y = 2
|
||||
window-padding-balance = false
|
||||
window-padding-color = background
|
||||
window-vsync = true
|
||||
window-inherit-working-directory = true
|
||||
window-inherit-font-size = true
|
||||
window-decoration = true
|
||||
window-title-font-family =
|
||||
window-theme = auto
|
||||
window-colorspace = srgb
|
||||
window-height = 51
|
||||
window-width = 189
|
||||
window-save-state = default
|
||||
window-step-resize = false
|
||||
window-new-tab-position = current
|
||||
resize-overlay = after-first
|
||||
resize-overlay-position = center
|
||||
resize-overlay-duration = 750ms
|
||||
focus-follows-mouse = false
|
||||
clipboard-read = ask
|
||||
clipboard-write = allow
|
||||
clipboard-trim-trailing-spaces = true
|
||||
clipboard-paste-protection = true
|
||||
clipboard-paste-bracketed-safe = true
|
||||
image-storage-limit = 320000000
|
||||
copy-on-select = false
|
||||
click-repeat-interval = 0
|
||||
initial-window = true
|
||||
shell-integration = detect
|
||||
shell-integration-features = cursor,no-sudo,title
|
||||
macos-non-native-fullscreen = false
|
||||
macos-titlebar-style = transparent
|
||||
macos-titlebar-proxy-icon = visible
|
||||
macos-option-as-alt =
|
||||
macos-window-shadow = true
|
||||
macos-auto-secure-input = true
|
||||
macos-secure-input-indication = true
|
||||
macos-icon = official
|
||||
macos-icon-frame = aluminum
|
||||
macos-icon-ghost-color =
|
||||
macos-icon-screen-color =
|
||||
linux-cgroup = single-instance
|
||||
linux-cgroup-memory-limit =
|
||||
linux-cgroup-processes-limit =
|
||||
linux-cgroup-hard-fail = false
|
||||
gtk-single-instance = desktop
|
||||
#gtk-titlebar = true
|
||||
gtk-titlebar = false
|
||||
gtk-tabs-location = top
|
||||
adw-toolbar-style = raised
|
||||
#adw-toast = clipboard-copy
|
||||
gtk-wide-tabs = true
|
||||
gtk-adwaita = true
|
||||
#gtk-custom-css =
|
||||
desktop-notifications = true
|
||||
bold-is-bright = false
|
||||
term = xterm-ghostty
|
||||
enquiry-response =
|
||||
auto-update = check
|
||||
auto-update-channel =
|
|
@ -0,0 +1 @@
|
|||
*.json
|
|
@ -0,0 +1,2 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 4
|
|
@ -0,0 +1,16 @@
|
|||
CIFAR
|
||||
MNIST
|
||||
LeNet
|
||||
MUL
|
||||
BCNN
|
||||
Grangegorman
|
||||
Cueto
|
||||
Mendoza
|
||||
Maynooth
|
||||
Frobenius
|
||||
Neuromorphic
|
||||
neuromorphic
|
||||
NN
|
||||
pytorch
|
||||
Pytorch
|
||||
SOTA
|
|
@ -0,0 +1,5 @@
|
|||
; extends
|
||||
(object
|
||||
(pair
|
||||
key: (_) @property.lhs
|
||||
value: (_) @property.inner @property.rhs) @property.outer)
|
|
@ -0,0 +1,2 @@
|
|||
require("user.core.init")
|
||||
require("user.lazy")
|
|
@ -0,0 +1,2 @@
|
|||
require("user.core.options")
|
||||
require("user.core.keymaps")
|
|
@ -0,0 +1,128 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode with jk" })
|
||||
|
||||
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "Clear search highlights" })
|
||||
|
||||
-- increment/decrement numbers
|
||||
keymap.set("n", "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
|
||||
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
|
||||
|
||||
-- window management
|
||||
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
||||
keymap.set("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
||||
keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" }) -- make split windows equal width & height
|
||||
keymap.set("n", "<leader>sx", "<cmd>close<CR>", { desc = "Close current split" }) -- close current split window
|
||||
|
||||
keymap.set("n", "<leader>to", "<cmd>tabnew<CR>", { desc = "Open new tab" }) -- open new tab
|
||||
keymap.set("n", "<leader>tx", "<cmd>tabclose<CR>", { desc = "Close current tab" }) -- close current tab
|
||||
keymap.set("n", "<leader>tn", "<cmd>tabn<CR>", { desc = "Go to next tab" }) -- go to next tab
|
||||
keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", { desc = "Go to previous tab" }) -- go to previous tab
|
||||
keymap.set("n", "<leader>tf", "<cmd>tabnew %<CR>", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab
|
||||
|
||||
-- Open Ex as buffer
|
||||
-- vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = "Open Ex" })
|
||||
vim.keymap.set("n", "<leader>pv", ":NvimTreeToggle<CR>", { desc = "Open Ex" })
|
||||
|
||||
-- Exit insert mode without hitting Esc
|
||||
vim.keymap.set("i", "jj", "<Esc>", { desc = "Esc" })
|
||||
|
||||
-- Make Y behave like C or D
|
||||
vim.keymap.set("n", "Y", "y$")
|
||||
|
||||
-- Keep window centered when going up/down
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- Paste without overwriting register
|
||||
vim.keymap.set("v", "p", '"_dP')
|
||||
|
||||
-- Copy text to " register
|
||||
vim.keymap.set("n", "<leader>y", '"+y', { desc = 'Yank into " register' })
|
||||
vim.keymap.set("v", "<leader>y", '"+y', { desc = 'Yank into " register' })
|
||||
vim.keymap.set("n", "<leader>Y", '"+Y', { desc = 'Yank into " register' })
|
||||
|
||||
-- Delete text to " register
|
||||
vim.keymap.set("n", "<leader>d", '"_d', { desc = 'Delete into " register' })
|
||||
vim.keymap.set("v", "<leader>d", '"_d', { desc = 'Delete into " register' })
|
||||
|
||||
-- Get out Q
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
|
||||
-- close buffer
|
||||
vim.keymap.set("n", "<leader>q", "<cmd>bd<CR>", { desc = "Close Buffer" })
|
||||
|
||||
-- Close buffer without closing split
|
||||
vim.keymap.set("n", "<leader>w", "<cmd>bp|bd #<CR>", { desc = "Close Buffer; Retain Split" })
|
||||
|
||||
-- Navigate between quickfix items
|
||||
vim.keymap.set("n", "<leader>h", "<cmd>cnext<CR>zz", { desc = "Forward qfixlist" })
|
||||
vim.keymap.set("n", "<leader>;", "<cmd>cprev<CR>zz", { desc = "Backward qfixlist" })
|
||||
|
||||
-- Navigate between location list items
|
||||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz", { desc = "Forward location list" })
|
||||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz", { desc = "Backward location list" })
|
||||
|
||||
-- Replace word under cursor across entire buffer
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>s",
|
||||
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
{ desc = "Replace word under cursor" }
|
||||
)
|
||||
|
||||
-- Make current file executable
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Make current file executable" })
|
||||
|
||||
-- Jump to plugin management file
|
||||
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/exosyphon/lazy.lua<CR>", { desc = "Jump to lazy.lua" })
|
||||
|
||||
-- Git revert at current cursor location
|
||||
vim.keymap.set("n", "<leader>U", "<cmd>GitGutterUndoHunk<CR>", { desc = "Revert Git Hunk" })
|
||||
|
||||
-- Copy file paths
|
||||
vim.keymap.set("n", "<leader>cf", '<cmd>let @+ = expand("%")<CR>', { desc = "Copy File Name" })
|
||||
vim.keymap.set("n", "<leader>cp", '<cmd>let @+ = expand("%:p")<CR>', { desc = "Copy File Path" })
|
||||
|
||||
vim.keymap.set("n", "<leader>so", function()
|
||||
vim.cmd("so")
|
||||
end, { desc = "Source current file" })
|
||||
|
||||
-- Resize with arrows
|
||||
vim.keymap.set("n", "<C-S-Down>", ":resize +2<CR>", { desc = "Resize Horizontal Split Down" })
|
||||
vim.keymap.set("n", "<C-S-Up>", ":resize -2<CR>", { desc = "Resize Horizontal Split Up" })
|
||||
vim.keymap.set("n", "<C-Left>", ":vertical resize -2<CR>", { desc = "Resize Vertical Split Down" })
|
||||
vim.keymap.set("n", "<C-Right>", ":vertical resize +2<CR>", { desc = "Resize Vertical Split Up" })
|
||||
|
||||
-- Open compiler
|
||||
vim.api.nvim_set_keymap("n", "<leader><leader>", "<cmd>CompilerOpen<cr>", { noremap = true, silent = true })
|
||||
|
||||
-- Redo last selected option
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader><leader><leader>",
|
||||
"<cmd>CompilerStop<cr>" -- (Optional, to dispose all tasks before redo)
|
||||
.. "<cmd>CompilerRedo<cr>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
-- Toggle compiler results
|
||||
vim.api.nvim_set_keymap("n", "<leader><leader>t", "<cmd>CompilerToggleResults<cr>", { noremap = true, silent = true })
|
||||
|
||||
-- Visual --
|
||||
-- Stay in indent mode
|
||||
vim.keymap.set("v", "<", "<gv")
|
||||
vim.keymap.set("v", ">", ">gv")
|
||||
|
||||
-- Move block
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move Block Down" })
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move Block Up" })
|
||||
|
||||
-- Search for highlighted text in buffer
|
||||
vim.keymap.set("v", "//", 'y/<C-R>"<CR>', { desc = "Search for highlighted text" })
|
|
@ -0,0 +1,86 @@
|
|||
-- NeoVim OPTIONS
|
||||
vim.opt.guicursor = ""
|
||||
|
||||
-- vim.opt.spelllang = 'en_gb'
|
||||
-- vim.opt.spell = true
|
||||
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.wrap = true
|
||||
-- Fonts
|
||||
vim.opt.encoding = "utf-8"
|
||||
|
||||
-- Undo
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
-- optionally enable 24-bit colour
|
||||
-- vim.opt.termguicolors = true
|
||||
|
||||
-- Folds
|
||||
vim.opt.foldmethod = "marker"
|
||||
--vim.opt.foldmethod = "expr"
|
||||
--vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
--vim.opt.foldcolumn = "0"
|
||||
--vim.opt.foldtext = ""
|
||||
--vim.opt.foldlevel = 99
|
||||
--vim.opt.foldlevelstart = 1
|
||||
--vim.opt.foldnestmax = 4
|
||||
|
||||
-- Providers (Not necesary)
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
vim.g.loaded_perl_provider = 0
|
||||
vim.g.loaded_node_provider = 0
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
vim.opt.colorcolumn = "110"
|
||||
|
||||
-- LSP options
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
-- Show line diagnostics automatically in hover window
|
||||
vim.o.updatetime = 250
|
||||
vim.cmd([[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]])
|
||||
|
||||
local f = io.popen("uname -s")
|
||||
if f ~= nil then
|
||||
MY_OS = f:read("*a")
|
||||
MY_OS = string.gsub(MY_OS, "%s+", "")
|
||||
f:close()
|
||||
end
|
||||
|
||||
if MY_OS == "Linux" then
|
||||
-- on Linux
|
||||
-- Python provider
|
||||
vim.g.python3_host_prog = "/usr/share/pyenv/shims/python"
|
||||
elseif (MY_OS == "FreeBSD") or (MY_OS == "OpenBSD") then
|
||||
-- on BSD
|
||||
-- Python provider
|
||||
vim.g.python3_host_prog = "/usr/local/share/pyenv/shims/python"
|
||||
elseif MY_OS == "Darwin" then
|
||||
-- on MacOS
|
||||
-- Python provider
|
||||
vim.g.python3_host_prog = "$HOME/.pyenv/shims/python"
|
||||
else
|
||||
print("Should never be here LSP")
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({ { import = "user.plugins" }, { import = "user.plugins.lsp" } }, {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
|
@ -0,0 +1,46 @@
|
|||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- local transparent = false -- set to true if you would like to enable transparency
|
||||
local transparent = true -- set to true if you would like to enable transparency
|
||||
|
||||
local bg = "#011628"
|
||||
local bg_dark = "#011423"
|
||||
local bg_highlight = "#143652"
|
||||
local bg_search = "#0A64AC"
|
||||
local bg_visual = "#275378"
|
||||
local fg = "#CBE0F0"
|
||||
local fg_dark = "#B4D0E9"
|
||||
local fg_gutter = "#627E97"
|
||||
local border = "#547998"
|
||||
|
||||
require("tokyonight").setup({
|
||||
style = "night",
|
||||
transparent = transparent,
|
||||
styles = {
|
||||
sidebars = transparent and "transparent" or "dark",
|
||||
floats = transparent and "transparent" or "dark",
|
||||
},
|
||||
on_colors = function(colors)
|
||||
colors.bg = bg
|
||||
colors.bg_dark = transparent and colors.none or bg_dark
|
||||
colors.bg_float = transparent and colors.none or bg_dark
|
||||
colors.bg_highlight = bg_highlight
|
||||
colors.bg_popup = bg_dark
|
||||
colors.bg_search = bg_search
|
||||
colors.bg_sidebar = transparent and colors.none or bg_dark
|
||||
colors.bg_statusline = transparent and colors.none or bg_dark
|
||||
colors.bg_visual = bg_visual
|
||||
colors.border = border
|
||||
colors.fg = fg
|
||||
colors.fg_dark = fg_dark
|
||||
colors.fg_float = fg
|
||||
colors.fg_gutter = fg_gutter
|
||||
colors.fg_sidebar = fg_dark
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme tokyonight")
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-treesitter plugin
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
-- configure treesitter
|
||||
treesitter.setup({ -- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
-- ensure these language parsers are installed
|
||||
ensure_installed = {
|
||||
"yaml",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"bash",
|
||||
"lua",
|
||||
"vim",
|
||||
"gitignore",
|
||||
"query",
|
||||
"vimdoc",
|
||||
"c",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" },
|
||||
["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" },
|
||||
["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" },
|
||||
["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" },
|
||||
|
||||
-- works for javascript/typescript files (custom capture I created in after/queries/ecma/textobjects.scm)
|
||||
["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" },
|
||||
["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" },
|
||||
["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" },
|
||||
["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" },
|
||||
|
||||
["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" },
|
||||
["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" },
|
||||
|
||||
["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" },
|
||||
["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" },
|
||||
|
||||
["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" },
|
||||
["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" },
|
||||
|
||||
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
|
||||
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
|
||||
|
||||
["am"] = {
|
||||
query = "@function.outer",
|
||||
desc = "Select outer part of a method/function definition",
|
||||
},
|
||||
["im"] = {
|
||||
query = "@function.inner",
|
||||
desc = "Select inner part of a method/function definition",
|
||||
},
|
||||
|
||||
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
|
||||
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>na"] = "@parameter.inner", -- swap parameters/argument with next
|
||||
["<leader>n:"] = "@property.outer", -- swap object property with next
|
||||
["<leader>nm"] = "@function.outer", -- swap function with next
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>pa"] = "@parameter.inner", -- swap parameters/argument with prev
|
||||
["<leader>p:"] = "@property.outer", -- swap object property with prev
|
||||
["<leader>pm"] = "@function.outer", -- swap function with previous
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]f"] = { query = "@call.outer", desc = "Next function call start" },
|
||||
["]m"] = { query = "@function.outer", desc = "Next method/function def start" },
|
||||
["]c"] = { query = "@class.outer", desc = "Next class start" },
|
||||
["]i"] = { query = "@conditional.outer", desc = "Next conditional start" },
|
||||
["]l"] = { query = "@loop.outer", desc = "Next loop start" },
|
||||
|
||||
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
|
||||
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
|
||||
["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" },
|
||||
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
|
||||
},
|
||||
goto_next_end = {
|
||||
["]F"] = { query = "@call.outer", desc = "Next function call end" },
|
||||
["]M"] = { query = "@function.outer", desc = "Next method/function def end" },
|
||||
["]C"] = { query = "@class.outer", desc = "Next class end" },
|
||||
["]I"] = { query = "@conditional.outer", desc = "Next conditional end" },
|
||||
["]L"] = { query = "@loop.outer", desc = "Next loop end" },
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[f"] = { query = "@call.outer", desc = "Prev function call start" },
|
||||
["[m"] = { query = "@function.outer", desc = "Prev method/function def start" },
|
||||
["[c"] = { query = "@class.outer", desc = "Prev class start" },
|
||||
["[i"] = { query = "@conditional.outer", desc = "Prev conditional start" },
|
||||
["[l"] = { query = "@loop.outer", desc = "Prev loop start" },
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[F"] = { query = "@call.outer", desc = "Prev function call end" },
|
||||
["[M"] = { query = "@function.outer", desc = "Prev method/function def end" },
|
||||
["[C"] = { query = "@class.outer", desc = "Prev class end" },
|
||||
["[I"] = { query = "@conditional.outer", desc = "Prev conditional end" },
|
||||
["[L"] = { query = "@loop.outer", desc = "Prev loop end" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move")
|
||||
|
||||
-- vim way: ; goes to the direction you were moving.
|
||||
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
|
||||
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
|
||||
|
||||
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
|
||||
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f)
|
||||
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F)
|
||||
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t)
|
||||
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
return {
|
||||
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||
"rafamadriz/friendly-snippets", -- useful snippets
|
||||
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview,noselect",
|
||||
},
|
||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
-- Allows selection with tab and shift-tab
|
||||
["<S-Tab>"] = cmp.mapping.select_prev_item(select_opts),
|
||||
["<Tab>"] = cmp.mapping.select_next_item(select_opts),
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
|
||||
-- configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
}),
|
||||
},
|
||||
})
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false },
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
-- BASH
|
||||
require("lspconfig")["bashls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- CLANG
|
||||
require("lspconfig")["clangd"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- CMAKE
|
||||
require("lspconfig")["cmake"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- LUA
|
||||
require("lspconfig")["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- LaTeX
|
||||
require("lspconfig")["ltex"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- PYTHON
|
||||
require("lspconfig")["pylsp"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- ZIG
|
||||
require("lspconfig")["zls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
python = { "pylint" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
{ -- This plugin
|
||||
"Zeioth/compiler.nvim",
|
||||
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
|
||||
dependencies = { "stevearc/overseer.nvim", "nvim-telescope/telescope.nvim" },
|
||||
opts = {},
|
||||
},
|
||||
{ -- The task runner we use
|
||||
"stevearc/overseer.nvim",
|
||||
commit = "6271cab7ccc4ca840faa93f54440ffae3a3918bd",
|
||||
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
|
||||
opts = {
|
||||
task_list = {
|
||||
direction = "bottom",
|
||||
min_height = 25,
|
||||
max_height = 25,
|
||||
default_detail = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- C/C++ debbuging
|
||||
{
|
||||
"sakhnik/nvim-gdb",
|
||||
},
|
||||
-- Rust debug
|
||||
{ "mfussenegger/nvim-dap" },
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^5", -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
config = function()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
vim.keymap.set("n", "<leader>a", function()
|
||||
vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping
|
||||
-- or vim.lsp.buf.codeAction() if you don't want grouping.
|
||||
end, { silent = true, buffer = bufnr })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||
function()
|
||||
vim.cmd.RustLsp({ "hover", "actions" })
|
||||
end,
|
||||
{ silent = true, buffer = bufnr }
|
||||
)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
return {
|
||||
"lervag/vimtex",
|
||||
lazy = false, -- we don't want to lazy load VimTeX
|
||||
-- tag = "v2.15", -- uncomment to pin to a specific release
|
||||
init = function()
|
||||
local f = io.popen("uname -s")
|
||||
if f ~= nil then
|
||||
MY_OS = f:read("*a")
|
||||
MY_OS = string.gsub(MY_OS, "%s+", "")
|
||||
f:close()
|
||||
end
|
||||
if MY_OS == "Linux" then
|
||||
-- on Linux
|
||||
-- Vimtex options:
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
vim.g.vimtex_general_viewer = "zathura"
|
||||
vim.g.vimtex_quickfix_mode = 0
|
||||
|
||||
-- Ignore mappings
|
||||
vim.g.vimtex_mappings_enabled = 1
|
||||
|
||||
---- Auto Indent
|
||||
vim.g["vimtex_indent_enabled"] = 1
|
||||
|
||||
---- Syntax highlighting
|
||||
vim.g.vimtex_syntax_enabled = 0
|
||||
|
||||
-- Error suppression:
|
||||
vim.g.vimtex_log_ignore = {
|
||||
"Underfull",
|
||||
"Overfull",
|
||||
"specifier changed to",
|
||||
"Token not allowed in a PDF string",
|
||||
}
|
||||
elseif (MY_OS == "FreeBSD") or (MY_OS == "OpenBSD") then
|
||||
-- on BSD
|
||||
-- Vimtex options:
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
vim.g.vimtex_general_viewer = "zathura"
|
||||
vim.g.vimtex_quickfix_mode = 0
|
||||
|
||||
-- OBSD options
|
||||
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
|
||||
|
||||
-- Ignore mappings
|
||||
vim.g.vimtex_mappings_enabled = 1
|
||||
|
||||
---- Auto Indent
|
||||
vim.g["vimtex_indent_enabled"] = 1
|
||||
|
||||
---- Syntax highlighting
|
||||
vim.g.vimtex_syntax_enabled = 0
|
||||
|
||||
-- Error suppression:
|
||||
vim.g.vimtex_log_ignore = {
|
||||
"Underfull",
|
||||
"Overfull",
|
||||
"specifier changed to",
|
||||
"Token not allowed in a PDF string",
|
||||
}
|
||||
elseif MY_OS == "Darwin" then
|
||||
-- on MacOS
|
||||
-- Vimtex options:
|
||||
vim.g.vimtex_view_method = "sioyek"
|
||||
vim.g.vimtex_view_sioyek_exe = "/Applications/sioyek.app/Contents/MacOS/sioyek"
|
||||
vim.g.vimtex_quickfix_mode = 0
|
||||
|
||||
-- Ignore mappings
|
||||
vim.g.vimtex_mappings_enabled = 1
|
||||
|
||||
---- Auto Indent
|
||||
vim.g.vimtex_indent_enabled = 1
|
||||
|
||||
---- Syntax highlighting
|
||||
vim.g.vimtex_syntax_enabled = 0
|
||||
|
||||
-- Error suppression:
|
||||
vim.g.vimtex_log_ignore = {
|
||||
"Underfull",
|
||||
"Overfull",
|
||||
"specifier changed to",
|
||||
"Token not allowed in a PDF string",
|
||||
}
|
||||
else
|
||||
print("Should never be here")
|
||||
end
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"tpope/vim-fugitive",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Open Fugitive Panel" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
{ "airblade/vim-gitgutter" },
|
||||
{ "mg979/vim-visual-multi" },
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = "kevinhwang91/promise-async",
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
opts = {},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local todo_comments = require("todo-comments")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "]t", function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
keymap.set("n", "[t", function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
|
||||
todo_comments.setup()
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"folke/trouble.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"folke/todo-comments.nvim",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local transform_mod = require("telescope.actions.mt").transform_mod
|
||||
|
||||
local trouble = require("trouble")
|
||||
local trouble_telescope = require("trouble.sources.telescope")
|
||||
|
||||
-- or create your custom action
|
||||
local custom_actions = transform_mod({
|
||||
open_trouble_qflist = function(prompt_bufnr)
|
||||
trouble.toggle("quickfix")
|
||||
end,
|
||||
})
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { "smart" },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
|
||||
["<C-t>"] = trouble_telescope.open,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
|
||||
keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
|
||||
keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "Find string under cursor in cwd" })
|
||||
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "Find todos" })
|
||||
keymap.set("n", "<leader>fb", "<cmd>Telescope buffers", { desc = "Find Buffers" })
|
||||
keymap.set("n", "<leader>fh", "<cmd>Telescope help_tags", { desc = "Find Help Tags" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols", { desc = "Find Symbols" })
|
||||
keymap.set("n", "<leader>fi", "<cmd>AdvancedGitSearch<CR>", { desc = "AdvancedGitSearch" })
|
||||
keymap.set("n", "<leader>fo", "<cmd>Telescope oldfiles", { desc = "Find Old Files" })
|
||||
keymap.set("n", "<leader>fw", "<cmd>Telescope grep_string", { desc = "Find Word under Cursor" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"nvim-neorg/neorg",
|
||||
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
|
||||
version = "*", -- Pin Neorg to the latest stable release
|
||||
config = function()
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
phd = "~/Work/Organization/2025-1st-Quatrimester/",
|
||||
regular = "~/Documents/Notes",
|
||||
},
|
||||
default_workspace = "phd",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"voldikss/vim-floaterm",
|
||||
config = function()
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>TS",
|
||||
"<cmd>:FloatermNew --height=0.3 --width=0.8 --wintype=float --name=floaterm1 --position=center --autoclose=2<CR>",
|
||||
{ desc = "Open FloatTerm" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>TT", "<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm" })
|
||||
vim.keymap.set("t", "<leader>TT", "<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"szw/vim-maximizer",
|
||||
keys = {
|
||||
{ "<leader>sm", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split" },
|
||||
},
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = { "InsertEnter" },
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-autopairs
|
||||
local autopairs = require("nvim-autopairs")
|
||||
|
||||
-- configure autopairs
|
||||
autopairs.setup({
|
||||
check_ts = true, -- enable treesitter
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
})
|
||||
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
-- import nvim-cmp plugin (completions plugin)
|
||||
local cmp = require("cmp")
|
||||
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"kylechui/nvim-surround",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = true,
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
-- recommended settings from nvim-tree documentation
|
||||
vim.g.netrw_liststyle = 3
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
nvimtree.setup({
|
||||
view = {
|
||||
width = 35,
|
||||
relativenumber = true,
|
||||
},
|
||||
-- change folder arrow icons
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
glyphs = {
|
||||
folder = {
|
||||
arrow_closed = "", -- arrow when folder is closed
|
||||
arrow_open = "", -- arrow when folder is open
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- disable window_picker for
|
||||
-- explorer to work well with
|
||||
-- window splits
|
||||
actions = {
|
||||
open_file = {
|
||||
window_picker = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
custom = { ".DS_Store" },
|
||||
dotfiles = true,
|
||||
},
|
||||
git = {
|
||||
ignore = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" }) -- toggle file explorer
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>ef",
|
||||
"<cmd>NvimTreeFindFileToggle<CR>",
|
||||
{ desc = "Toggle file explorer on current file" }
|
||||
) -- toggle file explorer on current file
|
||||
keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" }) -- collapse file explorer
|
||||
keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" }) -- refresh file explorer
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
||||
opts = {
|
||||
focus = true,
|
||||
},
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{ "<leader>xw", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open trouble workspace diagnostics" },
|
||||
{ "<leader>xd", "<cmd>Trouble diagnostics toggle filter.buf=0<CR>", desc = "Open trouble document diagnostics" },
|
||||
{ "<leader>xq", "<cmd>Trouble quickfix toggle<CR>", desc = "Open trouble quickfix list" },
|
||||
{ "<leader>xl", "<cmd>Trouble loclist toggle<CR>", desc = "Open trouble location list" },
|
||||
{ "<leader>xt", "<cmd>Trouble todo toggle<CR>", desc = "Open todos in trouble" },
|
||||
},
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
"gbprod/substitute.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local substitute = require("substitute")
|
||||
|
||||
substitute.setup()
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" })
|
||||
keymap.set("n", "ss", substitute.line, { desc = "Substitute line" })
|
||||
keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" })
|
||||
keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
|
||||
|
||||
local colors = {
|
||||
blue = "#65D1FF",
|
||||
green = "#3EFFDC",
|
||||
violet = "#FF61EF",
|
||||
yellow = "#FFDA7B",
|
||||
red = "#FF4A4A",
|
||||
fg = "#c3ccdc",
|
||||
bg = "#112638",
|
||||
inactive_bg = "#2c3043",
|
||||
}
|
||||
|
||||
local my_lualine_theme = {
|
||||
normal = {
|
||||
a = { bg = colors.blue, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
insert = {
|
||||
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
visual = {
|
||||
a = { bg = colors.violet, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
command = {
|
||||
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
replace = {
|
||||
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
inactive = {
|
||||
a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" },
|
||||
b = { bg = colors.inactive_bg, fg = colors.semilightgray },
|
||||
c = { bg = colors.inactive_bg, fg = colors.semilightgray },
|
||||
},
|
||||
}
|
||||
|
||||
-- configure lualine with modified theme
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = my_lualine_theme,
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{ "encoding" },
|
||||
{ "fileformat" },
|
||||
{ "filetype" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
liquid = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
main = "ibl",
|
||||
opts = {
|
||||
indent = { char = "┊" },
|
||||
},
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
-- Set header
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
-- Set menu
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
|
||||
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
|
||||
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||
dashboard.button("SPC wr", " > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
|
||||
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
|
||||
}
|
||||
|
||||
-- Send config to alpha
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
-- Disable folding on alpha buffer
|
||||
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
local auto_session = require("auto-session")
|
||||
|
||||
auto_session.setup({
|
||||
auto_restore_enabled = false,
|
||||
auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" },
|
||||
})
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory
|
||||
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
config = function()
|
||||
-- import comment plugin safely
|
||||
local comment = require("Comment")
|
||||
|
||||
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
|
||||
|
||||
-- enable comment
|
||||
comment.setup({
|
||||
-- for commenting tsx, jsx, svelte, html files
|
||||
pre_hook = ts_context_commentstring.create_pre_hook(),
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
version = "*",
|
||||
opts = {
|
||||
options = {
|
||||
mode = "tabs",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
|
||||
--"christoomey/vim-tmux-navigator", -- tmux & split window navigation
|
||||
"bronson/vim-trailing-whitespace",
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
return {
|
||||
"williamboman/mason.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
},
|
||||
config = function()
|
||||
-- import mason
|
||||
local mason = require("mason")
|
||||
|
||||
-- import mason-lspconfig
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
local mason_tool_installer = require("mason-tool-installer")
|
||||
|
||||
-- enable mason and configure icons
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"lua_ls",
|
||||
"ltex",
|
||||
"pyright",
|
||||
"zls",
|
||||
},
|
||||
})
|
||||
|
||||
mason_tool_installer.setup({
|
||||
ensure_installed = {
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"isort", -- python formatter
|
||||
"black", -- python formatter
|
||||
"pylint",
|
||||
"eslint_d",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,285 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
},
|
||||
config = function()
|
||||
-- Local word dictionary
|
||||
local path = vim.fn.stdpath("config") .. "/after/plugins/dictionary-gb.txt"
|
||||
print(path)
|
||||
local words = {}
|
||||
|
||||
for word in io.open(path, "r"):lines() do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
-- import lspconfig plugin
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- import mason_lspconfig plugin
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
-- import cmp-nvim-lsp plugin
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf, silent = true }
|
||||
|
||||
-- set keybinds
|
||||
opts.desc = "Show LSP references"
|
||||
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
|
||||
|
||||
opts.desc = "Go to declaration"
|
||||
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
|
||||
|
||||
opts.desc = "Show LSP definitions"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
|
||||
|
||||
opts.desc = "Show LSP implementations"
|
||||
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
|
||||
|
||||
opts.desc = "Show LSP type definitions"
|
||||
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
|
||||
|
||||
opts.desc = "See available code actions"
|
||||
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
|
||||
|
||||
opts.desc = "Smart rename"
|
||||
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
|
||||
|
||||
opts.desc = "Show buffer diagnostics"
|
||||
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
|
||||
|
||||
opts.desc = "Show line diagnostics"
|
||||
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
|
||||
|
||||
opts.desc = "Go to previous diagnostic"
|
||||
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
|
||||
|
||||
opts.desc = "Go to next diagnostic"
|
||||
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
|
||||
|
||||
opts.desc = "Show documentation for what is under cursor"
|
||||
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
|
||||
|
||||
opts.desc = "Restart LSP"
|
||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
|
||||
end,
|
||||
})
|
||||
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
-- (not in youtube nvim video)
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
-- default handler for installed servers
|
||||
--function(server_name)
|
||||
-- lspconfig[server_name].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
--end,
|
||||
["bashls"] = function()
|
||||
lspconfig["bashls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
["clangd"] = function()
|
||||
lspconfig["clangd"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
["cmake"] = function()
|
||||
lspconfig["cmake"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
--["fish_lsp"] = function()
|
||||
-- lspconfig["fish_lsp"].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
--end,
|
||||
["ltex"] = function()
|
||||
lspconfig["ltex"].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = {
|
||||
"bib",
|
||||
"gitcommit",
|
||||
"markdown",
|
||||
"org",
|
||||
"norg",
|
||||
"plaintex",
|
||||
"rst",
|
||||
"rnoweb",
|
||||
"tex",
|
||||
"pandoc",
|
||||
"quarto",
|
||||
"rmd",
|
||||
"context",
|
||||
"html",
|
||||
"xhtml",
|
||||
"mail",
|
||||
"text",
|
||||
},
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
dictionary = {
|
||||
["en-GB"] = words,
|
||||
},
|
||||
enabled = {
|
||||
"bibtex",
|
||||
"gitcommit",
|
||||
"markdown",
|
||||
"org",
|
||||
"tex",
|
||||
"restructuredtext",
|
||||
"rsweave",
|
||||
"latex",
|
||||
"quarto",
|
||||
"rmd",
|
||||
"context",
|
||||
"html",
|
||||
"xhtml",
|
||||
"mail",
|
||||
"plaintext",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
--["svelte"] = function()
|
||||
-- -- configure svelte server
|
||||
-- lspconfig["svelte"].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = function(client, bufnr)
|
||||
-- vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
-- pattern = { "*.js", "*.ts" },
|
||||
-- callback = function(ctx)
|
||||
-- -- Here use ctx.match instead of ctx.file
|
||||
-- client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- })
|
||||
--end,
|
||||
--["graphql"] = function()
|
||||
-- -- configure graphql language server
|
||||
-- lspconfig["graphql"].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
|
||||
-- })
|
||||
--end,
|
||||
--["emmet_ls"] = function()
|
||||
-- -- configure emmet language server
|
||||
-- lspconfig["emmet_ls"].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
|
||||
-- })
|
||||
--end,
|
||||
["lua_ls"] = function()
|
||||
-- configure lua server (with special settings)
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if
|
||||
vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc")
|
||||
then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
},
|
||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim", "require", "select_opts" },
|
||||
},
|
||||
format = {
|
||||
-- Put format options here
|
||||
-- NOTE: the value should be STRING!!
|
||||
defaultConfig = {
|
||||
indent_style = "space",
|
||||
indent_size = "4",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
["pylsp"] = function()
|
||||
-- configure graphql language server
|
||||
lspconfig["pylsp"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- formatter options
|
||||
black = { enabled = true },
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
-- linter options
|
||||
pylint = { enabled = false, executable = "pylint" },
|
||||
pyflakes = { enabled = false },
|
||||
pycodestyle = { enabled = true, maxLineLength = 110 },
|
||||
-- type checker
|
||||
pylsp_mypy = { enabled = true },
|
||||
-- auto-completion options
|
||||
jedi_completion = { fuzzy = true },
|
||||
-- import sorting
|
||||
pyls_isort = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 200,
|
||||
},
|
||||
})
|
||||
end,
|
||||
["zls"] = function()
|
||||
lspconfig["zls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
cmd = { "~/.local/bin/zls" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
# openSUSE theme
|
||||
default_border pixel 2
|
||||
gaps inner 10
|
||||
#client.focused #6da741 #173f4f #73ba25
|
||||
client.focused #00ff00 #00ff00 #00ff00 #00ff00
|
||||
client.unfocused #00a489 #173f4f #35b9ab
|
||||
client.focused_inactive #6da741 #00a489 #173f4f
|
||||
|
||||
#don't show gaps if there's only one window on the desktop
|
||||
smart_gaps on
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
|
||||
# Home row direction keys, like vim
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
# Waybar position
|
||||
set $waybar_position top
|
||||
|
||||
# Your preferred terminal emulator
|
||||
#set $term alacritty #--config-file ~/.config/alacritty/alacritty.yml
|
||||
set $term ghostty
|
||||
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
#set $menu dmenu_path | dmenu | xargs swaymsg exec --
|
||||
# it is set in config.d/50-openSUSE.conf
|
||||
|
||||
# wofi as application launcher
|
||||
set $menu wofi -I -S drun
|
||||
#set $menu rofi -no-lazy-grab -disable-history -modi "drun" -show drun -theme ~/.config/rofi/config.rasi
|
||||
|
||||
# Sway Notification Centre
|
||||
set $toggle_notification "swaync-client -t -sw"
|
||||
|
||||
# Wob
|
||||
set $wob wob --config ~/.config/sway/wob/wob.ini
|
||||
|
||||
# background
|
||||
set $background ~/.config/backgrounds/tokyonight.jpg
|
||||
|
||||
# monitors
|
||||
set $ext_monitor HDMI-A-1
|
||||
set $int_monitor eDP-1
|
||||
|
||||
# screen capture
|
||||
set $screen grimshot copy
|
||||
# screen capture
|
||||
set $screen_area grimshot copy area
|
||||
|
||||
|
||||
include ~/.config/sway/config.d/*.conf
|
||||
include ~/.config/sway/inputs/*.conf
|
||||
include ~/.config/sway/outputs/*.conf
|
||||
include ~/.config/sway/modes/*.conf
|
||||
include ~/.config/sway/config.d/*
|
|
@ -0,0 +1,143 @@
|
|||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
# Start a terminal
|
||||
bindsym $mod+Shift+Return exec $term
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+c kill
|
||||
|
||||
# Start your launcher
|
||||
bindsym $mod+p exec $menu
|
||||
|
||||
# Screen capture
|
||||
bindsym $mod+Print exec $screen
|
||||
|
||||
# Screen capture area
|
||||
bindsym $mod+Shift+Print exec $screen_area
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+q reload
|
||||
|
||||
# Exit sway (logs you out of your Wayland session)
|
||||
bindsym $mod+Shift+q exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
|
||||
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
# Or use $mod+[up|down|left|right]
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
# Ditto, with arrow keys
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace number 1
|
||||
bindsym $mod+2 workspace number 2
|
||||
bindsym $mod+3 workspace number 3
|
||||
bindsym $mod+4 workspace number 4
|
||||
bindsym $mod+5 workspace number 5
|
||||
bindsym $mod+6 workspace number 6
|
||||
bindsym $mod+7 workspace number 7
|
||||
bindsym $mod+8 workspace number 8
|
||||
bindsym $mod+9 workspace number 9
|
||||
bindsym $mod+0 workspace number 10
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace number 1
|
||||
bindsym $mod+Shift+2 move container to workspace number 2
|
||||
bindsym $mod+Shift+3 move container to workspace number 3
|
||||
bindsym $mod+Shift+4 move container to workspace number 4
|
||||
bindsym $mod+Shift+5 move container to workspace number 5
|
||||
bindsym $mod+Shift+6 move container to workspace number 6
|
||||
bindsym $mod+Shift+7 move container to workspace number 7
|
||||
bindsym $mod+Shift+8 move container to workspace number 8
|
||||
bindsym $mod+Shift+9 move container to workspace number 9
|
||||
bindsym $mod+Shift+0 move container to workspace number 10
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
bindsym $mod+b splith
|
||||
bindsym $mod+v splitv
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Cycle through workspaces
|
||||
bindsym $mod+tab workspace next_on_output
|
||||
bindsym $mod+Shift+tab workspace prev_on_output
|
||||
|
||||
bindsym --to-code {
|
||||
$mod+b splith
|
||||
$mod+v splitv
|
||||
}
|
||||
|
||||
# Media keys
|
||||
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
|
||||
bindsym XF86MonBrightnessDown exec brightnessctl -q set 5%- && ( echo $((`brightnessctl get` * 100 / `brightnessctl m`)) > $SWAYSOCK.wob )
|
||||
bindsym XF86MonBrightnessUp exec brightnessctl -q set +5% && ( echo $((`brightnessctl get` * 100 / `brightnessctl m`)) > $SWAYSOCK.wob )
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec pamixer --allow-boost -ui 2 && dc -e "[`pamixer --get-volume`]sM 100d `pamixer --get-volume`<Mp" > $SWAYSOCK.wob
|
||||
bindsym XF86AudioLowerVolume exec pamixer --allow-boost -ud 2 && dc -e "[`pamixer --get-volume`]sM 100d `pamixer --get-volume`<Mp" > $SWAYSOCK.wob
|
||||
bindsym XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $SWAYSOCK.wob )
|
||||
|
||||
# Media player controls
|
||||
bindsym --no-warn XF86AudioPlay exec playerctl play-pause
|
||||
bindsym --no-warn XF86AudioNext exec playerctl next
|
||||
bindsym --no-warn XF86AudioPrev exec playerctl previous
|
||||
|
||||
# Shutdown
|
||||
# unbindsym $mod+Shift+q
|
||||
# bindsym $mod+Shift+q mode $mode_system
|
||||
|
||||
# Toggle notification bar
|
||||
bindsym $mod+Shift+n exec $toggle_notification
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
|
||||
# See FS#63021
|
||||
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.
|
||||
|
||||
# Upstream refuses to set XDG_CURRENT_DESKTOP so we have to.
|
||||
exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
|
||||
exec systemctl --user import-environment DISPLAY \
|
||||
SWAYSOCK \
|
||||
WAYLAND_DISPLAY \
|
||||
XDG_CURRENT_DESKTOP
|
||||
|
||||
exec hash dbus-update-activation-environment 2>/dev/null && \
|
||||
dbus-update-activation-environment --systemd DISPLAY \
|
||||
SWAYSOCK \
|
||||
XDG_CURRENT_DESKTOP=sway \
|
||||
WAYLAND_DISPLAY
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# Status Bar:
|
||||
#
|
||||
bar {
|
||||
id default
|
||||
swaybar_command waybar
|
||||
position $waybar_position
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
# enable numlock
|
||||
input * xkb_numlock enable
|
||||
|
||||
exec {
|
||||
'[ -x "$(command -v blueman-applet)" ] && blueman-applet'
|
||||
#'[ -x "$(command -v ~/.config/waybar/scripts/battery-notification.sh)" ] && ~/.config/waybar/scripts/battery-notification.sh'
|
||||
# Default wallpaper
|
||||
swaybg -o $int_monitor -i $background
|
||||
swaybg -o $ext_monitor -i $background
|
||||
}
|
||||
|
||||
exec_always {
|
||||
emacs --daemon
|
||||
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
|
||||
gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
|
||||
gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
|
||||
systemctl --user import-environment
|
||||
test -e $SWAYSOCK.wob || mkfifo $SWAYSOCK.wob
|
||||
tail -f $SWAYSOCK.wob | $wob
|
||||
swaync --style ~/.config/sway/swaync/style.css --config ~/.config/sway/swaync/config.json
|
||||
}
|
||||
|
||||
exec /usr/libexec/polkit-gnome-authentication-agent-1
|
|
@ -0,0 +1,17 @@
|
|||
# recomended enviroment variables for sway based desktop
|
||||
# openSUSEway installs/imports this to/from:
|
||||
# /usr/lib/environment.d/50-openSUSE.conf
|
||||
# /etc/profile.d/openSUSEway.sh
|
||||
MOZ_ENABLE_WAYLAND=1
|
||||
QT_QPA_PLATFORM=wayland-egl
|
||||
CLUTTER_BACKEND=wayland
|
||||
ECORE_EVAS_ENGINE=wayland-egl
|
||||
ELM_ENGINE=wayland_egl
|
||||
SDL_VIDEODRIVER=wayland
|
||||
_JAVA_AWT_WM_NONREPARENTING=1
|
||||
NO_AT_BRIDGE=1
|
||||
|
||||
# QT theme for openSUSEway
|
||||
# needs qt5ct and adwaita-qt5 packages
|
||||
# default config is /etc/xdg/qt5ct/qt5ct.conf
|
||||
QT_QPA_PLATFORMTHEME=qt5ct
|
|
@ -0,0 +1,14 @@
|
|||
### Input configuration
|
||||
#
|
||||
# You can get the names of your inputs by running: swaymsg -t get_inputs
|
||||
# Read `man 5 sway-input` for more information about this section.
|
||||
|
||||
#input type:keyboard {
|
||||
# xkb_layout "us"
|
||||
#}
|
||||
|
||||
input type:keyboard {
|
||||
xkb_layout "us"
|
||||
xkb_variant "altgr-intl"
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
### Input configuration
|
||||
#
|
||||
# You can get the names of your inputs by running: swaymsg -t get_inputs
|
||||
# Read `man 5 sway-input` for more information about this section.
|
||||
input type:touchpad {
|
||||
dwt enabled
|
||||
tap enabled
|
||||
natural_scroll enabled
|
||||
}
|
||||
|
||||
#input type:mouse {
|
||||
# map_to_output eDP-1
|
||||
#}
|
||||
#
|
||||
#input type:touchpad {
|
||||
# map_to_output eDP-1
|
||||
#}
|
||||
#
|
||||
#input type:tablet_tool {
|
||||
# map_to_output eDP-1
|
||||
#}
|
||||
#
|
||||
#input type:touch {
|
||||
# map_to_output eDP-1
|
||||
#}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||
|
||||
### Idle configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
# exec swayidle -w \
|
||||
# timeout 300 'swaylock -f -c 000000' \
|
||||
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||
# before-sleep 'swaylock -f -c 000000'
|
||||
#
|
||||
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||
# your displays after another 300 seconds, and turn your screens back on when
|
||||
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||
|
||||
# Lockscreen configuration
|
||||
set $screenlock 'swaylock -f -c 000000'
|
||||
# Idle configuration
|
||||
exec swayidle -w \
|
||||
timeout 7200 $screenlock \
|
||||
timeout 3600 'swaymsg "output * dpms off"' \
|
||||
resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep $screenlock
|
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
bindsym $left resize shrink width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize grow width 10px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 10px
|
||||
bindsym Down resize grow height 10px
|
||||
bindsym Up resize shrink height 10px
|
||||
bindsym Right resize grow width 10px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
|
@ -0,0 +1,15 @@
|
|||
# System mode menu
|
||||
set $mode_system "What to do? (l) lock, (e) logout, (r) reboot, (s) suspend, (Shift+s) shutdown"
|
||||
|
||||
mode $mode_system {
|
||||
bindsym l exec $screenlock; mode "default"
|
||||
bindsym e exec swaymsg exit; mode "default"
|
||||
bindsym r exec systemctl reboot; mode "default"
|
||||
bindsym s exec systemctl suspend; mode "default"
|
||||
bindsym Shift+s exec systemctl poweroff; mode "default"
|
||||
|
||||
# back to normal: Enter or Escape
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
set $mode_recording "<span foreground='$color10'></span> \
|
||||
<span foreground='$color5'><b>Record</b></span> <span foreground='$color10'>(<b>r</b>)</span> \
|
||||
<span foreground='$color5'>+ [<span foreground='$color10'><b>Shift</b></span> for ]</span>"
|
||||
|
||||
set $recorder /usr/share/sway/scripts/recorder.sh
|
||||
|
||||
mode --pango_markup $mode_recording {
|
||||
$bindsym r exec $recorder, mode "default"
|
||||
$bindsym Shift+r exec $recorder -a, mode "default"
|
||||
|
||||
# Return to default mode.
|
||||
$bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
## Launch // Recording Mode ##
|
||||
$bindsym $mod+Shift+r mode $mode_recording
|
||||
|
||||
## Launch // Stop Recording Mode ##
|
||||
$bindsym $mod+Escape exec killall -s SIGINT wf-recorder
|
|
@ -0,0 +1,23 @@
|
|||
set $mode_screenshot "<span foreground='$color10'></span> \
|
||||
<span foreground='$color5'><b>Pick</b></span> <span foreground='$color10'>(<b>p</b>)</span> \
|
||||
<span foreground='$color5'><b>Output</b></span> <span foreground='$color10'>(<b>o</b>)</span> \
|
||||
<span foreground='$color7'>+ <span foreground='$color10'><b>Shift</b></span> for </span> \
|
||||
<span foreground='$color7'>+ <span foreground='$color10'><b>Ctrl</b></span> for </span>"
|
||||
|
||||
mode --pango_markup $mode_screenshot {
|
||||
# output = currently active output
|
||||
$bindsym o mode "default", exec $screenshot_screen_clipboard
|
||||
$bindsym Shift+o mode "default", exec $screenshot_screen_file
|
||||
$bindsym Shift+Ctrl+o mode "default", exec $screenshot_screen_upload
|
||||
|
||||
# pick the region to screenshot
|
||||
$bindsym p mode "default", exec $screenshot_selection_clipboard
|
||||
$bindsym Shift+p mode "default", exec $screenshot_selection_file
|
||||
$bindsym Shift+Ctrl+p mode "default", exec $screenshot_selection_upload
|
||||
|
||||
# Return to default mode.
|
||||
$bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
## Launch // Screenshot Mode ##
|
||||
$bindsym Print mode $mode_screenshot
|
|
@ -0,0 +1,35 @@
|
|||
### Output configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
# output HDMI-A-1 resolution 1920x1080 position 1920,0
|
||||
#
|
||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||
# Default wallpaper output * bg $background fill
|
||||
#
|
||||
# output $ext_monitor pos 0 0 res 1920x1080 output $int_monitor pos 1920 0 res 1920x1080
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||
|
||||
|
||||
|
||||
output $ext_monitor pos 0 0 res 1920x1080
|
||||
output $int_monitor pos 1920 0 res 1920x1080
|
||||
|
||||
# focus output $ext_monitor
|
||||
# focus output $int_monitor
|
||||
|
||||
bindswitch --reload --locked lid:on output $int_monitor disable
|
||||
bindswitch --reload --locked lid:off output $int_monitor enable
|
||||
|
||||
workspace 1 output $ext_monitor
|
||||
workspace 2 output $ext_monitor
|
||||
workspace 3 output $ext_monitor
|
||||
workspace 4 output $ext_monitor
|
||||
workspace 5 output $ext_monitor
|
||||
workspace 6 output $int_monitor
|
||||
workspace 7 output $int_monitor
|
||||
workspace 8 output $int_monitor
|
||||
workspace 9 output $int_monitor
|
||||
workspace 0 output $int_monitor
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"$schema": "/etc/xdg/swaync/configSchema.json",
|
||||
"positionX": "right",
|
||||
"positionY": "top",
|
||||
"control-center-margin-top": 0,
|
||||
"control-center-margin-bottom": 0,
|
||||
"control-center-margin-right": 0,
|
||||
"control-center-margin-left": 0,
|
||||
"notification-icon-size": 64,
|
||||
"notification-body-image-height": 100,
|
||||
"notification-body-image-width": 200,
|
||||
"timeout": 10,
|
||||
"timeout-low": 5,
|
||||
"timeout-critical": 0,
|
||||
"fit-to-screen": true,
|
||||
"control-center-width": 500,
|
||||
"control-center-height": 600,
|
||||
"notification-window-width": 500,
|
||||
"keyboard-shortcuts": true,
|
||||
"image-visibility": "when-available",
|
||||
"transition-time": 200,
|
||||
"hide-on-clear": false,
|
||||
"hide-on-action": true,
|
||||
"script-fail-notify": true,
|
||||
"scripts": {
|
||||
"example-script": {
|
||||
"exec": "echo 'Do something...'",
|
||||
"urgency": "Normal"
|
||||
}
|
||||
},
|
||||
"notification-visibility": {
|
||||
"example-name": {
|
||||
"state": "muted",
|
||||
"urgency": "Low",
|
||||
"app-name": "Spotify"
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue