Adding the configuration files
This commit is contained in:
parent
1e1856af0e
commit
c65e1fe274
|
@ -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,4 @@
|
||||||
|
[flavor]
|
||||||
|
use = "tokyo-night"
|
||||||
|
# For Yazi 0.4 and above
|
||||||
|
dark = "tokyo-night"
|
|
@ -0,0 +1,6 @@
|
||||||
|
auto-save-list/
|
||||||
|
eshell/
|
||||||
|
recentf
|
||||||
|
straight/
|
||||||
|
tramp
|
||||||
|
transient/
|
|
@ -0,0 +1,640 @@
|
||||||
|
#+Property: Header-args :tangle init.el
|
||||||
|
#+auto_tangle: t
|
||||||
|
#+AUTHOR: Eduardo Cueto-Mendoza based on Chris Smith a.k.a LTG
|
||||||
|
|
||||||
|
* Table of Contents :TOC:
|
||||||
|
- [[#package-management-system][PACKAGE MANAGEMENT SYSTEM]]
|
||||||
|
- [[#straightel][STRAIGHT.EL]]
|
||||||
|
- [[#use-package][USE PACKAGE]]
|
||||||
|
- [[#backup][BACKUP]]
|
||||||
|
- [[#packages][PACKAGES]]
|
||||||
|
- [[#beacon][BEACON]]
|
||||||
|
- [[#focus][FOCUS]]
|
||||||
|
- [[#magit][MAGIT]]
|
||||||
|
- [[#rainbow-mode][RAINBOW Mode]]
|
||||||
|
- [[#rainbow-delimiters][Rainbow Delimiters]]
|
||||||
|
- [[#highlight-todo][Highlight TODO]]
|
||||||
|
- [[#which-key][WHICH-KEY]]
|
||||||
|
- [[#vterm][VTERM]]
|
||||||
|
- [[#vterm-toggle][VTERM-TOGGLE]]
|
||||||
|
- [[#treemacs][TREEMACS]]
|
||||||
|
- [[#doom-modeline][DOOM-MODELINE]]
|
||||||
|
- [[#all-the-icons][ALL-THE-ICONS]]
|
||||||
|
- [[#org-mode][ORG-MODE]]
|
||||||
|
- [[#org-auto-tangle][ORG-AUTO-TANGLE]]
|
||||||
|
- [[#org-definitions][ORG DEFINITIONS]]
|
||||||
|
- [[#toc-org][TOC-ORG]]
|
||||||
|
- [[#org-modern-mode][ORG-MODERN-MODE]]
|
||||||
|
- [[#org-tempo][ORG-TEMPO]]
|
||||||
|
- [[#vertico][VERTICO]]
|
||||||
|
- [[#vertico-directory][Vertico-Directory]]
|
||||||
|
- [[#company][COMPANY]]
|
||||||
|
- [[#marginalia][MARGINALIA]]
|
||||||
|
- [[#embark][EMBARK]]
|
||||||
|
- [[#evil][EVIL]]
|
||||||
|
- [[#dashboard][DASHBOARD]]
|
||||||
|
- [[#consult][Consult]]
|
||||||
|
- [[#perspective][Perspective]]
|
||||||
|
- [[#garbage-collection][GARBAGE COLLECTION]]
|
||||||
|
- [[#native-compile][NATIVE COMPILE]]
|
||||||
|
- [[#user-interface-enhancements][USER INTERFACE ENHANCEMENTS]]
|
||||||
|
- [[#enabling-return-for-min-buffer-questions][Enabling Return for min-buffer questions]]
|
||||||
|
- [[#disable-electric-indent][DISABLE ELECTRIC INDENT]]
|
||||||
|
- [[#fonts-and-themes][Fonts and Themes]]
|
||||||
|
- [[#zooming-inout][Zooming IN/OUT]]
|
||||||
|
- [[#general-keybinds][GENERAL KEYBINDS]]
|
||||||
|
|
||||||
|
* PACKAGE MANAGEMENT SYSTEM
|
||||||
|
** STRAIGHT.EL
|
||||||
|
We are using straight.el intead of using package.el as our package manager, below is the boostrap code in order for it to work.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; Install straight.el
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(let ((bootstrap-file
|
||||||
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||||
|
(bootstrap-version 6))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* USE PACKAGE
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq straight-use-package-by-default t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* BACKUP
|
||||||
|
Put all backup files in the Trash can, by default emacs makes these annoying backup files on the filesystem and this will make it where those backups goto the trash
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq backup-directory-alist '((".*" . "~/.local/share/Trash/files")))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* PACKAGES
|
||||||
|
** BEACON
|
||||||
|
BEACON is a package so you never lose your mouse cursor again, it will highlight a line where your mouse cursor is.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package beacon)
|
||||||
|
#+end_src
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package doom-themes)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** FOCUS
|
||||||
|
This is package that dims surrounding text while typing
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package focus)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** MAGIT
|
||||||
|
Magit is a fully featured git client for emacs
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package magit)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** RAINBOW Mode
|
||||||
|
Display the actual color for a hex value, works in all modes
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package rainbow-mode
|
||||||
|
:hook org-mode prog-mode)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Rainbow Delimiters
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package rainbow-delimiters
|
||||||
|
:hook ((org-mode . rainbow-delimiters-mode)
|
||||||
|
(prog-mode . rainbow-delimiters-mode)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Highlight TODO
|
||||||
|
Highlight certain words in documents and colorize them
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package hl-todo
|
||||||
|
:hook ((org-mode . hl-todo-mode)
|
||||||
|
(prog-mode . hl-todo-mode))
|
||||||
|
:config
|
||||||
|
(setq hl-todo-highlight-punctuation ":"
|
||||||
|
hl-todo-keyword-faces
|
||||||
|
`(("TODO" warning bold)
|
||||||
|
("FIXME" error bold)
|
||||||
|
("HACK" font-lock-constant-face bold)
|
||||||
|
("REVIEW" font-lock-keyword-face bold)
|
||||||
|
("NOTE" success bold)
|
||||||
|
("DEPRECATED" font-lock-doc-face bold))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** WHICH-KEY
|
||||||
|
Which-key is a program to display what keys are next on your minibuffer
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package which-key
|
||||||
|
:straight t
|
||||||
|
:init
|
||||||
|
(which-key-mode 1)
|
||||||
|
:config
|
||||||
|
(setq which-key-side-window-location 'bottom
|
||||||
|
which-key-sort-order #'which-key-key-order
|
||||||
|
which-key-allow-imprecise-window-fit nil
|
||||||
|
which-key-sort-uppercase-first nil
|
||||||
|
which-key-add-column-padding 1
|
||||||
|
which-key-max-display-columns nil
|
||||||
|
which-key-min-display-lines 6
|
||||||
|
which-key-side-window-slot -10
|
||||||
|
which-key-side-window-max-height 0.25
|
||||||
|
which-key-idle-delay 0.8
|
||||||
|
which-key-max-description-length 25
|
||||||
|
which-key-allow-imprecise-window-fit nil
|
||||||
|
which-key-separator " → " ))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** VTERM
|
||||||
|
Vterm is a terminal emulator within in Emacs. The default shell is set to fish but it could be changed
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package vterm
|
||||||
|
:config
|
||||||
|
(setq shell-file-name "/bin/fish"
|
||||||
|
vterm-max-scrollback 5000))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** VTERM-TOGGLE
|
||||||
|
Vterm-toggle toggles between the vterm buffer and what ever buffer your editing
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package vterm-toggle
|
||||||
|
:after vterm
|
||||||
|
:config
|
||||||
|
(setq vterm-toggle-fullscreen-p nil)
|
||||||
|
(setq vterm-toggle-scope 'project)
|
||||||
|
(add-to-list 'display-buffer-alist
|
||||||
|
'((lambda (buffer-or-name _)
|
||||||
|
(let ((buffer (get-buffer buffer-or-name)))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(or (equal major-mode 'vterm-mode)
|
||||||
|
(string-prefix-p vterm-buffer-name (buffer-name buffer))))))
|
||||||
|
(display-buffer-reuse-window display-buffer-at-bottom)
|
||||||
|
;;(display-buffer-reuse-window display-buffer-in-direction)
|
||||||
|
;;display-buffer-in-direction/direction/dedicated is added in emacs27
|
||||||
|
;;(direction . bottom)
|
||||||
|
;;(dedicated . t) ;dedicated is supported in emacs27
|
||||||
|
(reusable-frames . visible)
|
||||||
|
(window-height . 0.3))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** TREEMACS
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package treemacs
|
||||||
|
:ensure t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
(use-package treemacs-icons-dired
|
||||||
|
:hook (dired-mode . treemacs-icons-dired-enable-once)
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package treemacs-persp
|
||||||
|
:after (treemacs persp-mode)
|
||||||
|
:ensure t
|
||||||
|
:config (treemacs-set-scope-type 'Perspectives))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** DOOM-MODELINE
|
||||||
|
Doom-modeline is a modeline for your minibuffer, doom-modeline was inspired by 'doom-emacs'
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package doom-modeline
|
||||||
|
:straight t
|
||||||
|
:init (doom-modeline-mode 1))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** ALL-THE-ICONS
|
||||||
|
All the icons is a package to display proper symbols/icons on the modeline.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package all-the-icons
|
||||||
|
:if (display-graphic-p))
|
||||||
|
|
||||||
|
(use-package all-the-icons-dired
|
||||||
|
:hook (dired-mode . (lambda () (all-the-icons-dired-mode t))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* ORG-MODE
|
||||||
|
** ORG-AUTO-TANGLE
|
||||||
|
Org-auto-tangle is a package that will automaticlly tangle your org file for you when you save your .org document. Set #+auto_tangle: t in your header file.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package org-auto-tangle
|
||||||
|
:defer t
|
||||||
|
:hook (org-mode . org-auto-tangle-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** ORG DEFINITIONS
|
||||||
|
Setting some default .org definitions.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||||
|
(setq org-directory "~/.emacs.d/Org/"
|
||||||
|
org-agenda-files '("~/.emacs.d/Org/agenda.org")
|
||||||
|
org-default-notes-file (expand-file-name "notes.org" org-directory)
|
||||||
|
org-ellipsis " ▼ "
|
||||||
|
org-log-done 'time
|
||||||
|
org-journal-dir "~/.emacs.d/Org/journal/"
|
||||||
|
org-journal-date-format "%d %B, %Y (%A) "
|
||||||
|
org-journal-file-format "%Y-%m-%d.org"
|
||||||
|
org-hide-emphasis-markers t)
|
||||||
|
(setq org-src-preserve-indentation nil
|
||||||
|
org-src-tab-acts-natively t
|
||||||
|
org-edit-src-content-indentation 0
|
||||||
|
org-src-fontify-natively t
|
||||||
|
org-confirm-babel-evaluate nil)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** TOC-ORG
|
||||||
|
This package will automaticlly generate a table of contents in org mode. use :TOC: at the end of your table of contents header.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package toc-org
|
||||||
|
:commands toc-org-enable
|
||||||
|
:init (add-hook 'org-mode-hook 'toc-org-enable))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** ORG-MODERN-MODE
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package org-modern)
|
||||||
|
(with-eval-after-load 'org (global-org-modern-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** ORG-TEMPO
|
||||||
|
This package allows you to type '<s followed by TAB to expand a tag
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package org-tempo
|
||||||
|
:straight nil)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** VERTICO
|
||||||
|
Vertico provides a performant and minimalistic vertical completion UI based on the default completion system
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;;install vertico
|
||||||
|
(use-package vertico
|
||||||
|
:init
|
||||||
|
(vertico-mode)
|
||||||
|
|
||||||
|
;; Different scroll margin
|
||||||
|
;; (setq vertico-scroll-margin 0)
|
||||||
|
|
||||||
|
;; Show more candidates
|
||||||
|
(setq vertico-count 20)
|
||||||
|
|
||||||
|
;; Grow and shrink the Vertico minibuffer
|
||||||
|
(setq vertico-resize t)
|
||||||
|
|
||||||
|
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
|
||||||
|
(setq vertico-cycle t))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Vertico-Directory
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package vertico-directory
|
||||||
|
:after vertico
|
||||||
|
:straight nil
|
||||||
|
:load-path "straight/repos/vertico/extensions/"
|
||||||
|
:bind (:map vertico-map
|
||||||
|
("RET" . vertico-directory-enter)
|
||||||
|
("DEL" . vertico-directory-delete-char)
|
||||||
|
("M-DEL" . vertico-directory-delete-word))
|
||||||
|
|
||||||
|
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** COMPANY
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(use-package company
|
||||||
|
:ensure
|
||||||
|
:custom
|
||||||
|
(company-idle-delay 0.1)
|
||||||
|
(global-company-mode t)
|
||||||
|
:bind
|
||||||
|
(:map company-active-map
|
||||||
|
("C-n" . company-select-next)
|
||||||
|
("C-p" . company-select-previous)
|
||||||
|
("M-<" . company-select-first)
|
||||||
|
("M->" . company-select-last))
|
||||||
|
|
||||||
|
(:map company-mode-map
|
||||||
|
("<tab>" . tab-indent-or-complete)
|
||||||
|
("TAB" . tab-indent-or-complete)))
|
||||||
|
|
||||||
|
(defun company-yasnippet-or-completion ()
|
||||||
|
(interactive)
|
||||||
|
(or (do-yas-expand)
|
||||||
|
(company-complete-common)))
|
||||||
|
|
||||||
|
(defun check-expansion ()
|
||||||
|
(save-excursion
|
||||||
|
(if (looking-at "\\_>") t
|
||||||
|
(backward-char 1)
|
||||||
|
(if (looking-at "\\.") t
|
||||||
|
(backward-char 1)
|
||||||
|
(if (looking-at "::") t nil)))))
|
||||||
|
|
||||||
|
(defun do-yas-expand ()
|
||||||
|
(let ((yas/fallback-behavior 'return-nil))
|
||||||
|
(yas/expand)))
|
||||||
|
|
||||||
|
|
||||||
|
(defun tab-indent-or-complete ()
|
||||||
|
(interactive)
|
||||||
|
(if (minibufferp)
|
||||||
|
(minibuffer-complete)
|
||||||
|
(if (or (not yas/minor-mode)
|
||||||
|
(null (do-yas-expand)))
|
||||||
|
(if (check-expansion)
|
||||||
|
(company-complete-common)
|
||||||
|
(indent-for-tab-command)))))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package company-box
|
||||||
|
:after company
|
||||||
|
:hook (company-mode . company-box-mode))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
** MARGINALIA
|
||||||
|
This package provides marginalia-mode which adds marginalia to the minibuffer completions.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; Enable rich annotations using the Marginalia package
|
||||||
|
(use-package marginalia
|
||||||
|
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||||
|
;; available in the *Completions* buffer, add it to the
|
||||||
|
;; `completion-list-mode-map'.
|
||||||
|
:bind (:map minibuffer-local-map
|
||||||
|
("M-A" . marginalia-cycle))
|
||||||
|
|
||||||
|
;; The :init section is always executed.
|
||||||
|
:init
|
||||||
|
|
||||||
|
;; Marginalia must be actived in the :init section of use-package such that
|
||||||
|
;; the mode gets enabled right away. Note that this forces loading the
|
||||||
|
;; package.
|
||||||
|
(marginalia-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** EMBARK
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package embark
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package embark-consult
|
||||||
|
:straight t
|
||||||
|
:hook
|
||||||
|
(embark-collection-mode . consult-preview-at-point-mode))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** EVIL
|
||||||
|
Evil Mode is 'vim keybindings for EMACS. We are setting "evil-mode" by default.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package evil
|
||||||
|
:straight t
|
||||||
|
:init
|
||||||
|
(setq evil-want-keybinding nil)
|
||||||
|
(setq evil-vsplit-window-right t)
|
||||||
|
(setq evil-split-window-below t)
|
||||||
|
:config
|
||||||
|
(evil-mode 1))
|
||||||
|
|
||||||
|
(use-package evil-collection
|
||||||
|
:after evil
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(evil-collection-init))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** DASHBOARD
|
||||||
|
This is a startup dashboard for emacs, it shows recent files, projects and your org-agendas.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;;install dashboard
|
||||||
|
(use-package dashboard
|
||||||
|
:straight t
|
||||||
|
:init
|
||||||
|
(setq dashboard-set-heading-icons t)
|
||||||
|
(setq dashboard-set-file-icons t)
|
||||||
|
(setq dashboard-banner-logo-title "emacs rocks")
|
||||||
|
(setq dashboard-startup-banner 'logo)
|
||||||
|
(setq dashboard-center-content nil)
|
||||||
|
(setq dashboard-items '((recents . 5)
|
||||||
|
;;(projects . 3)
|
||||||
|
(agenda . 3))))
|
||||||
|
|
||||||
|
:config
|
||||||
|
(dashboard-setup-startup-hook)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** Consult
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package consult)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(use-package consult-dir
|
||||||
|
:straight t
|
||||||
|
:bind (("C-x C-d" . consult-dir)
|
||||||
|
:map vertico-map
|
||||||
|
("C-x C-d" . consult-dir)
|
||||||
|
("C-x C-j" . consult.dir-jump-file)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Perspective
|
||||||
|
This package adds workspaces for your buffers in Emacs. This package is very similiar in how a tiling window manager works with its workspaces.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package perspective
|
||||||
|
:bind
|
||||||
|
("C-x C-b" . persp-list-buffers) ; or use a nicer switcher, see below
|
||||||
|
:custom
|
||||||
|
(persp-mode-prefix-key (kbd "C-c M-p")) ; pick your own prefix key here
|
||||||
|
:init
|
||||||
|
(persp-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* GARBAGE COLLECTION
|
||||||
|
GC is the process of freeing up memory from unused/used up variables. We set the threshold on the GC so emacs will be a little faster.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; Using garbage magic hack.
|
||||||
|
(use-package gcmh
|
||||||
|
:config
|
||||||
|
(gcmh-mode 1))
|
||||||
|
;; Setting garbage collection threshold
|
||||||
|
(setq gc-cons-threshold 402653184
|
||||||
|
gc-cons-percentage 0.6)
|
||||||
|
|
||||||
|
;; Profile emacs startup
|
||||||
|
(add-hook 'emacs-startup-hook
|
||||||
|
(lambda ()
|
||||||
|
(message "*** Emacs loaded in %s with %d garbage collections."
|
||||||
|
(format "%.2f seconds"
|
||||||
|
(float-time
|
||||||
|
(time-subtract after-init-time before-init-time)))
|
||||||
|
gcs-done)))
|
||||||
|
|
||||||
|
;; Silence compiler warnings as they can be pretty disruptive (setq comp-async-report-warnings-errors nil)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* NATIVE COMPILE
|
||||||
|
Native Compile support and silence some annoying warnings when a package gets installed.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; Silence compiler warnings as they can be pretty disruptive
|
||||||
|
(if (boundp 'comp-deferred-compilation)
|
||||||
|
(setq comp-deferred-compilation nil)
|
||||||
|
(setq native-comp-deferred-compilation nil))
|
||||||
|
;; In noninteractive sessions, prioritize non-byte-compiled source files to
|
||||||
|
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
|
||||||
|
;; to skip the mtime checks on every *.elc file.
|
||||||
|
(setq load-prefer-newer noninteractive)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* USER INTERFACE ENHANCEMENTS
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; load dashboard instead of scratchpad at startup *INSTALL DASHBOARD*
|
||||||
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
||||||
|
;;(load-theme 'doom-tokyo-night :no-confirm) ; Set theme
|
||||||
|
(load-theme 'doom-xcode :no-confirm) ; Set theme
|
||||||
|
(menu-bar-mode -1) ; Turn menubar off
|
||||||
|
(scroll-bar-mode -1) ; Turn scrollbar off
|
||||||
|
(tool-bar-mode -1) ; Turn tool-bar off
|
||||||
|
(global-display-line-numbers-mode 1) ; Display line numbers globally
|
||||||
|
(beacon-mode 1) ; Turn beacon on
|
||||||
|
(toggle-frame-maximized)
|
||||||
|
(setq inhibit-startup-screen t) ; Disable startup default startup screen
|
||||||
|
(setq auto-save-interval 1000)
|
||||||
|
(setq make-backup-files nil) ; Disable automatic backup files
|
||||||
|
#+end_src
|
||||||
|
* Enabling Return for min-buffer questions
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(defun y-or-n-p-with-return (orig-func &rest args)
|
||||||
|
(let ((query-replace-map (copy-keymap query-replace-map)))
|
||||||
|
(define-key query-replace-map (kbd "RET") 'act)
|
||||||
|
(apply orig-func args)))
|
||||||
|
|
||||||
|
(advice-add 'y-or-n-p :around #'y-or-n-p-with-return)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* DISABLE ELECTRIC INDENT
|
||||||
|
fix some of the weird indents in org mode
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(electric-indent-mode -1)
|
||||||
|
(setq org-edit-src-content-indentation 0)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* Fonts and Themes
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(set-face-attribute 'default nil
|
||||||
|
:family "Terminess Nerd Font"
|
||||||
|
:height 180
|
||||||
|
:weight 'bold)
|
||||||
|
(set-face-attribute 'variable-pitch nil
|
||||||
|
:family "Terminess Nerd Font"
|
||||||
|
:height 180
|
||||||
|
:weight 'semibold)
|
||||||
|
(set-face-attribute 'fixed-pitch nil
|
||||||
|
:family "Terminess Nerd Font"
|
||||||
|
:height 180
|
||||||
|
:weight 'bold)
|
||||||
|
;; Makes commented text and keywords italics.
|
||||||
|
;; This is working in emacsclient but not emacs.
|
||||||
|
;; Your font must have an italic face available.
|
||||||
|
(set-face-attribute 'font-lock-comment-face nil
|
||||||
|
:slant 'italic)
|
||||||
|
(set-face-attribute 'font-lock-keyword-face nil
|
||||||
|
:slant 'italic)
|
||||||
|
|
||||||
|
;;(add-to-list 'default-frame-alist '(font . "JetBrainsMono Nerd Font-14"))
|
||||||
|
|
||||||
|
(setq pixel-scroll-precision-mode 1)
|
||||||
|
;; Uncomment the following line if line spacing needs adjusting.
|
||||||
|
;;(setq-default line-spacing 0.12)
|
||||||
|
|
||||||
|
(add-to-list 'default-frame-alist '(alpha-background . 90))
|
||||||
|
;; Needed if using emacsclient. Otherwise, your fonts will be smaller than expected.
|
||||||
|
;;(add-to-list 'default-frame-alist '(font . "SauceCodePro Nerd Font-16" :weight 'semibold))
|
||||||
|
;; changes certain keywords to symbols, such as lamda!
|
||||||
|
(setq global-prettify-symbols-mode t)
|
||||||
|
;;(add-hook 'find-file-hook (lambda () (set-face-attribute 'default nil :height 105)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
: t
|
||||||
|
|
||||||
|
|
||||||
|
* Zooming IN/OUT
|
||||||
|
Zoom in with Cntrl+ and out with Cntrl-, also use mousewheel up to zoomin and mousewheel down to zoom out
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(global-set-key (kbd "C-+") 'text-scale-increase)
|
||||||
|
(global-set-key (kbd "C--") 'text-scale-decrease)
|
||||||
|
;; (global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
|
||||||
|
;; (global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
* GENERAL KEYBINDS
|
||||||
|
General provides a more convenient way method for binding keys in emacs that works for both 'evil mode' and 'non-evil-mode'.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;;install general
|
||||||
|
|
||||||
|
;; (global-set-key (kbd "C-t") 'vterm-toggle)
|
||||||
|
|
||||||
|
(use-package general
|
||||||
|
:config
|
||||||
|
(general-evil-setup)
|
||||||
|
|
||||||
|
;; set up 'SPC' as the global leader key
|
||||||
|
(general-create-definer ltg/leader-keys
|
||||||
|
:states '(normal insert visual emacs)
|
||||||
|
:keymaps 'override
|
||||||
|
:prefix "SPC" ;; set leader
|
||||||
|
:global-prefix "M-SPC")
|
||||||
|
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"SPC" '(execute-extended-command :wk "M-x")
|
||||||
|
"." '(find-file :wk "Find file")
|
||||||
|
"f f" '(find-file :wk "Find file")
|
||||||
|
"t t" 'vterm-toggle
|
||||||
|
"t l" 'eshell
|
||||||
|
"=" '(perspective-map :wk "Perspective") ;; Lists all the perspective keybindings
|
||||||
|
"TAB TAB" '(comment-line :wk "Comment lines")
|
||||||
|
"u" '(universal-argument :wk "Universal argument"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"b" '(:ignore t :wk "Buffers")
|
||||||
|
"b i" '(ibuffer :wk "Ibuffer")
|
||||||
|
"b p" '(previous-buffer :wk "Previous buffer")
|
||||||
|
"b n" '(next-buffer :wk "Next buffer"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"d" '(:ignore t :wk "Dired")
|
||||||
|
"d d" '(dired :wk "Open Dired")
|
||||||
|
"d j" '(dired-jump :wk "Dired jump to current"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"f" '(:ignore t :wk "Files")
|
||||||
|
"f c" '((lambda () (interactive) (find-file "~/.emacs.d/README.org")) :wk "Open emacs config")
|
||||||
|
"f d" '(find-grep-dired :wk "Search for strings in files in DIR"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"e" '(:ignore t :wk "Evaluate")
|
||||||
|
"e r" '(eval-region :wk "Eval Region")
|
||||||
|
"e b" '(eval-buffer :wk "Eval Buffer"))
|
||||||
|
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
|
|
@ -0,0 +1,431 @@
|
||||||
|
;; Install straight.el
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(let ((bootstrap-file
|
||||||
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||||
|
(bootstrap-version 6))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
|
||||||
|
(setq straight-use-package-by-default t)
|
||||||
|
|
||||||
|
(setq backup-directory-alist '((".*" . "~/.local/share/Trash/files")))
|
||||||
|
|
||||||
|
(use-package beacon)
|
||||||
|
|
||||||
|
(use-package doom-themes)
|
||||||
|
|
||||||
|
(use-package focus)
|
||||||
|
|
||||||
|
(use-package magit)
|
||||||
|
|
||||||
|
(use-package rainbow-mode
|
||||||
|
:hook org-mode prog-mode)
|
||||||
|
|
||||||
|
(use-package rainbow-delimiters
|
||||||
|
:hook ((org-mode . rainbow-delimiters-mode)
|
||||||
|
(prog-mode . rainbow-delimiters-mode)))
|
||||||
|
|
||||||
|
(use-package hl-todo
|
||||||
|
:hook ((org-mode . hl-todo-mode)
|
||||||
|
(prog-mode . hl-todo-mode))
|
||||||
|
:config
|
||||||
|
(setq hl-todo-highlight-punctuation ":"
|
||||||
|
hl-todo-keyword-faces
|
||||||
|
`(("TODO" warning bold)
|
||||||
|
("FIXME" error bold)
|
||||||
|
("HACK" font-lock-constant-face bold)
|
||||||
|
("REVIEW" font-lock-keyword-face bold)
|
||||||
|
("NOTE" success bold)
|
||||||
|
("DEPRECATED" font-lock-doc-face bold))))
|
||||||
|
|
||||||
|
(use-package which-key
|
||||||
|
:straight t
|
||||||
|
:init
|
||||||
|
(which-key-mode 1)
|
||||||
|
:config
|
||||||
|
(setq which-key-side-window-location 'bottom
|
||||||
|
which-key-sort-order #'which-key-key-order
|
||||||
|
which-key-allow-imprecise-window-fit nil
|
||||||
|
which-key-sort-uppercase-first nil
|
||||||
|
which-key-add-column-padding 1
|
||||||
|
which-key-max-display-columns nil
|
||||||
|
which-key-min-display-lines 6
|
||||||
|
which-key-side-window-slot -10
|
||||||
|
which-key-side-window-max-height 0.25
|
||||||
|
which-key-idle-delay 0.8
|
||||||
|
which-key-max-description-length 25
|
||||||
|
which-key-allow-imprecise-window-fit nil
|
||||||
|
which-key-separator " → " ))
|
||||||
|
|
||||||
|
(use-package vterm
|
||||||
|
:config
|
||||||
|
(setq shell-file-name "/bin/fish"
|
||||||
|
vterm-max-scrollback 5000))
|
||||||
|
|
||||||
|
(use-package vterm-toggle
|
||||||
|
:after vterm
|
||||||
|
:config
|
||||||
|
(setq vterm-toggle-fullscreen-p nil)
|
||||||
|
(setq vterm-toggle-scope 'project)
|
||||||
|
(add-to-list 'display-buffer-alist
|
||||||
|
'((lambda (buffer-or-name _)
|
||||||
|
(let ((buffer (get-buffer buffer-or-name)))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(or (equal major-mode 'vterm-mode)
|
||||||
|
(string-prefix-p vterm-buffer-name (buffer-name buffer))))))
|
||||||
|
(display-buffer-reuse-window display-buffer-at-bottom)
|
||||||
|
;;(display-buffer-reuse-window display-buffer-in-direction)
|
||||||
|
;;display-buffer-in-direction/direction/dedicated is added in emacs27
|
||||||
|
;;(direction . bottom)
|
||||||
|
;;(dedicated . t) ;dedicated is supported in emacs27
|
||||||
|
(reusable-frames . visible)
|
||||||
|
(window-height . 0.3))))
|
||||||
|
|
||||||
|
(use-package treemacs
|
||||||
|
:ensure t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
(use-package treemacs-icons-dired
|
||||||
|
:hook (dired-mode . treemacs-icons-dired-enable-once)
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package treemacs-persp
|
||||||
|
:after (treemacs persp-mode)
|
||||||
|
:ensure t
|
||||||
|
:config (treemacs-set-scope-type 'Perspectives))
|
||||||
|
|
||||||
|
(use-package doom-modeline
|
||||||
|
:straight t
|
||||||
|
:init (doom-modeline-mode 1))
|
||||||
|
|
||||||
|
(use-package all-the-icons
|
||||||
|
:if (display-graphic-p))
|
||||||
|
|
||||||
|
(use-package all-the-icons-dired
|
||||||
|
:hook (dired-mode . (lambda () (all-the-icons-dired-mode t))))
|
||||||
|
|
||||||
|
(use-package org-auto-tangle
|
||||||
|
:defer t
|
||||||
|
:hook (org-mode . org-auto-tangle-mode))
|
||||||
|
|
||||||
|
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||||
|
(setq org-directory "~/.emacs.d/Org/"
|
||||||
|
org-agenda-files '("~/.emacs.d/Org/agenda.org")
|
||||||
|
org-default-notes-file (expand-file-name "notes.org" org-directory)
|
||||||
|
org-ellipsis " ▼ "
|
||||||
|
org-log-done 'time
|
||||||
|
org-journal-dir "~/.emacs.d/Org/journal/"
|
||||||
|
org-journal-date-format "%d %B, %Y (%A) "
|
||||||
|
org-journal-file-format "%Y-%m-%d.org"
|
||||||
|
org-hide-emphasis-markers t)
|
||||||
|
(setq org-src-preserve-indentation nil
|
||||||
|
org-src-tab-acts-natively t
|
||||||
|
org-edit-src-content-indentation 0
|
||||||
|
org-src-fontify-natively t
|
||||||
|
org-confirm-babel-evaluate nil)
|
||||||
|
|
||||||
|
(use-package toc-org
|
||||||
|
:commands toc-org-enable
|
||||||
|
:init (add-hook 'org-mode-hook 'toc-org-enable))
|
||||||
|
|
||||||
|
(use-package org-modern)
|
||||||
|
(with-eval-after-load 'org (global-org-modern-mode))
|
||||||
|
|
||||||
|
(use-package org-tempo
|
||||||
|
:straight nil)
|
||||||
|
|
||||||
|
;;install vertico
|
||||||
|
(use-package vertico
|
||||||
|
:init
|
||||||
|
(vertico-mode)
|
||||||
|
|
||||||
|
;; Different scroll margin
|
||||||
|
;; (setq vertico-scroll-margin 0)
|
||||||
|
|
||||||
|
;; Show more candidates
|
||||||
|
(setq vertico-count 20)
|
||||||
|
|
||||||
|
;; Grow and shrink the Vertico minibuffer
|
||||||
|
(setq vertico-resize t)
|
||||||
|
|
||||||
|
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
|
||||||
|
(setq vertico-cycle t))
|
||||||
|
|
||||||
|
(use-package vertico-directory
|
||||||
|
:after vertico
|
||||||
|
:straight nil
|
||||||
|
:load-path "straight/repos/vertico/extensions/"
|
||||||
|
:bind (:map vertico-map
|
||||||
|
("RET" . vertico-directory-enter)
|
||||||
|
("DEL" . vertico-directory-delete-char)
|
||||||
|
("M-DEL" . vertico-directory-delete-word))
|
||||||
|
|
||||||
|
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||||
|
|
||||||
|
(use-package company
|
||||||
|
:ensure
|
||||||
|
:custom
|
||||||
|
(company-idle-delay 0.1)
|
||||||
|
(global-company-mode t)
|
||||||
|
:bind
|
||||||
|
(:map company-active-map
|
||||||
|
("C-n" . company-select-next)
|
||||||
|
("C-p" . company-select-previous)
|
||||||
|
("M-<" . company-select-first)
|
||||||
|
("M->" . company-select-last))
|
||||||
|
|
||||||
|
(:map company-mode-map
|
||||||
|
("<tab>" . tab-indent-or-complete)
|
||||||
|
("TAB" . tab-indent-or-complete)))
|
||||||
|
|
||||||
|
(defun company-yasnippet-or-completion ()
|
||||||
|
(interactive)
|
||||||
|
(or (do-yas-expand)
|
||||||
|
(company-complete-common)))
|
||||||
|
|
||||||
|
(defun check-expansion ()
|
||||||
|
(save-excursion
|
||||||
|
(if (looking-at "\\_>") t
|
||||||
|
(backward-char 1)
|
||||||
|
(if (looking-at "\\.") t
|
||||||
|
(backward-char 1)
|
||||||
|
(if (looking-at "::") t nil)))))
|
||||||
|
|
||||||
|
(defun do-yas-expand ()
|
||||||
|
(let ((yas/fallback-behavior 'return-nil))
|
||||||
|
(yas/expand)))
|
||||||
|
|
||||||
|
|
||||||
|
(defun tab-indent-or-complete ()
|
||||||
|
(interactive)
|
||||||
|
(if (minibufferp)
|
||||||
|
(minibuffer-complete)
|
||||||
|
(if (or (not yas/minor-mode)
|
||||||
|
(null (do-yas-expand)))
|
||||||
|
(if (check-expansion)
|
||||||
|
(company-complete-common)
|
||||||
|
(indent-for-tab-command)))))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package company-box
|
||||||
|
:after company
|
||||||
|
:hook (company-mode . company-box-mode))
|
||||||
|
|
||||||
|
;; Enable rich annotations using the Marginalia package
|
||||||
|
(use-package marginalia
|
||||||
|
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||||
|
;; available in the *Completions* buffer, add it to the
|
||||||
|
;; `completion-list-mode-map'.
|
||||||
|
:bind (:map minibuffer-local-map
|
||||||
|
("M-A" . marginalia-cycle))
|
||||||
|
|
||||||
|
;; The :init section is always executed.
|
||||||
|
:init
|
||||||
|
|
||||||
|
;; Marginalia must be actived in the :init section of use-package such that
|
||||||
|
;; the mode gets enabled right away. Note that this forces loading the
|
||||||
|
;; package.
|
||||||
|
(marginalia-mode))
|
||||||
|
|
||||||
|
(use-package embark
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package embark-consult
|
||||||
|
:straight t
|
||||||
|
:hook
|
||||||
|
(embark-collection-mode . consult-preview-at-point-mode))
|
||||||
|
|
||||||
|
(use-package evil
|
||||||
|
:straight t
|
||||||
|
:init
|
||||||
|
(setq evil-want-keybinding nil)
|
||||||
|
(setq evil-vsplit-window-right t)
|
||||||
|
(setq evil-split-window-below t)
|
||||||
|
:config
|
||||||
|
(evil-mode 1))
|
||||||
|
|
||||||
|
(use-package evil-collection
|
||||||
|
:after evil
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(evil-collection-init))
|
||||||
|
|
||||||
|
;;install dashboard
|
||||||
|
(use-package dashboard
|
||||||
|
:straight t
|
||||||
|
:init
|
||||||
|
(setq dashboard-set-heading-icons t)
|
||||||
|
(setq dashboard-set-file-icons t)
|
||||||
|
(setq dashboard-banner-logo-title "emacs rocks")
|
||||||
|
(setq dashboard-startup-banner 'logo)
|
||||||
|
(setq dashboard-center-content nil)
|
||||||
|
(setq dashboard-items '((recents . 5)
|
||||||
|
;;(projects . 3)
|
||||||
|
(agenda . 3))))
|
||||||
|
|
||||||
|
:config
|
||||||
|
(dashboard-setup-startup-hook)
|
||||||
|
|
||||||
|
(use-package consult)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(use-package consult-dir
|
||||||
|
:straight t
|
||||||
|
:bind (("C-x C-d" . consult-dir)
|
||||||
|
:map vertico-map
|
||||||
|
("C-x C-d" . consult-dir)
|
||||||
|
("C-x C-j" . consult.dir-jump-file)))
|
||||||
|
|
||||||
|
(use-package perspective
|
||||||
|
:bind
|
||||||
|
("C-x C-b" . persp-list-buffers) ; or use a nicer switcher, see below
|
||||||
|
:custom
|
||||||
|
(persp-mode-prefix-key (kbd "C-c M-p")) ; pick your own prefix key here
|
||||||
|
:init
|
||||||
|
(persp-mode))
|
||||||
|
|
||||||
|
;; Using garbage magic hack.
|
||||||
|
(use-package gcmh
|
||||||
|
:config
|
||||||
|
(gcmh-mode 1))
|
||||||
|
;; Setting garbage collection threshold
|
||||||
|
(setq gc-cons-threshold 402653184
|
||||||
|
gc-cons-percentage 0.6)
|
||||||
|
|
||||||
|
;; Profile emacs startup
|
||||||
|
(add-hook 'emacs-startup-hook
|
||||||
|
(lambda ()
|
||||||
|
(message "*** Emacs loaded in %s with %d garbage collections."
|
||||||
|
(format "%.2f seconds"
|
||||||
|
(float-time
|
||||||
|
(time-subtract after-init-time before-init-time)))
|
||||||
|
gcs-done)))
|
||||||
|
|
||||||
|
;; Silence compiler warnings as they can be pretty disruptive (setq comp-async-report-warnings-errors nil)
|
||||||
|
|
||||||
|
;; Silence compiler warnings as they can be pretty disruptive
|
||||||
|
(if (boundp 'comp-deferred-compilation)
|
||||||
|
(setq comp-deferred-compilation nil)
|
||||||
|
(setq native-comp-deferred-compilation nil))
|
||||||
|
;; In noninteractive sessions, prioritize non-byte-compiled source files to
|
||||||
|
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
|
||||||
|
;; to skip the mtime checks on every *.elc file.
|
||||||
|
(setq load-prefer-newer noninteractive)
|
||||||
|
|
||||||
|
;; load dashboard instead of scratchpad at startup *INSTALL DASHBOARD*
|
||||||
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
||||||
|
;;(load-theme 'doom-tokyo-night :no-confirm) ; Set theme
|
||||||
|
(load-theme 'doom-xcode :no-confirm) ; Set theme
|
||||||
|
(menu-bar-mode -1) ; Turn menubar off
|
||||||
|
(scroll-bar-mode -1) ; Turn scrollbar off
|
||||||
|
(tool-bar-mode -1) ; Turn tool-bar off
|
||||||
|
(global-display-line-numbers-mode 1) ; Display line numbers globally
|
||||||
|
(beacon-mode 1) ; Turn beacon on
|
||||||
|
(toggle-frame-maximized)
|
||||||
|
(setq inhibit-startup-screen t) ; Disable startup default startup screen
|
||||||
|
(setq auto-save-interval 1000)
|
||||||
|
(setq make-backup-files nil) ; Disable automatic backup files
|
||||||
|
|
||||||
|
(defun y-or-n-p-with-return (orig-func &rest args)
|
||||||
|
(let ((query-replace-map (copy-keymap query-replace-map)))
|
||||||
|
(define-key query-replace-map (kbd "RET") 'act)
|
||||||
|
(apply orig-func args)))
|
||||||
|
|
||||||
|
(advice-add 'y-or-n-p :around #'y-or-n-p-with-return)
|
||||||
|
|
||||||
|
(electric-indent-mode -1)
|
||||||
|
(setq org-edit-src-content-indentation 0)
|
||||||
|
|
||||||
|
(set-face-attribute 'default nil
|
||||||
|
:family "Terminess Nerd Font"
|
||||||
|
:height 180
|
||||||
|
:weight 'bold)
|
||||||
|
(set-face-attribute 'variable-pitch nil
|
||||||
|
:family "Terminess Nerd Font"
|
||||||
|
:height 180
|
||||||
|
:weight 'semibold)
|
||||||
|
(set-face-attribute 'fixed-pitch nil
|
||||||
|
:family "Terminess Nerd Font"
|
||||||
|
:height 180
|
||||||
|
:weight 'bold)
|
||||||
|
;; Makes commented text and keywords italics.
|
||||||
|
;; This is working in emacsclient but not emacs.
|
||||||
|
;; Your font must have an italic face available.
|
||||||
|
(set-face-attribute 'font-lock-comment-face nil
|
||||||
|
:slant 'italic)
|
||||||
|
(set-face-attribute 'font-lock-keyword-face nil
|
||||||
|
:slant 'italic)
|
||||||
|
|
||||||
|
;;(add-to-list 'default-frame-alist '(font . "JetBrainsMono Nerd Font-14"))
|
||||||
|
|
||||||
|
(setq pixel-scroll-precision-mode 1)
|
||||||
|
;; Uncomment the following line if line spacing needs adjusting.
|
||||||
|
;;(setq-default line-spacing 0.12)
|
||||||
|
|
||||||
|
(add-to-list 'default-frame-alist '(alpha-background . 90))
|
||||||
|
;; Needed if using emacsclient. Otherwise, your fonts will be smaller than expected.
|
||||||
|
;;(add-to-list 'default-frame-alist '(font . "SauceCodePro Nerd Font-16" :weight 'semibold))
|
||||||
|
;; changes certain keywords to symbols, such as lamda!
|
||||||
|
(setq global-prettify-symbols-mode t)
|
||||||
|
;;(add-hook 'find-file-hook (lambda () (set-face-attribute 'default nil :height 105)))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-+") 'text-scale-increase)
|
||||||
|
(global-set-key (kbd "C--") 'text-scale-decrease)
|
||||||
|
;; (global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
|
||||||
|
;; (global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
|
||||||
|
|
||||||
|
;;install general
|
||||||
|
|
||||||
|
;; (global-set-key (kbd "C-t") 'vterm-toggle)
|
||||||
|
|
||||||
|
(use-package general
|
||||||
|
:config
|
||||||
|
(general-evil-setup)
|
||||||
|
|
||||||
|
;; set up 'SPC' as the global leader key
|
||||||
|
(general-create-definer ltg/leader-keys
|
||||||
|
:states '(normal insert visual emacs)
|
||||||
|
:keymaps 'override
|
||||||
|
:prefix "SPC" ;; set leader
|
||||||
|
:global-prefix "M-SPC")
|
||||||
|
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"SPC" '(execute-extended-command :wk "M-x")
|
||||||
|
"." '(find-file :wk "Find file")
|
||||||
|
"f f" '(find-file :wk "Find file")
|
||||||
|
"t t" 'vterm-toggle
|
||||||
|
"t l" 'eshell
|
||||||
|
"=" '(perspective-map :wk "Perspective") ;; Lists all the perspective keybindings
|
||||||
|
"TAB TAB" '(comment-line :wk "Comment lines")
|
||||||
|
"u" '(universal-argument :wk "Universal argument"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"b" '(:ignore t :wk "Buffers")
|
||||||
|
"b i" '(ibuffer :wk "Ibuffer")
|
||||||
|
"b p" '(previous-buffer :wk "Previous buffer")
|
||||||
|
"b n" '(next-buffer :wk "Next buffer"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"d" '(:ignore t :wk "Dired")
|
||||||
|
"d d" '(dired :wk "Open Dired")
|
||||||
|
"d j" '(dired-jump :wk "Dired jump to current"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"f" '(:ignore t :wk "Files")
|
||||||
|
"f c" '((lambda () (interactive) (find-file "~/.emacs.d/README.org")) :wk "Open emacs config")
|
||||||
|
"f d" '(find-grep-dired :wk "Search for strings in files in DIR"))
|
||||||
|
|
||||||
|
(ltg/leader-keys
|
||||||
|
"e" '(:ignore t :wk "Evaluate")
|
||||||
|
"e r" '(eval-region :wk "Eval Region")
|
||||||
|
"e b" '(eval-buffer :wk "Eval Buffer"))
|
||||||
|
|
||||||
|
)
|
|
@ -0,0 +1 @@
|
||||||
|
("~/Code/Rust/Projects/e-learning/lrn/src/" "~/Code/Rust/tutorial/e-learning/tutorial/" "~/Code/Rust/Learning/src/")
|
|
@ -0,0 +1,21 @@
|
||||||
|
[user]
|
||||||
|
signingkey = 5B6FDEEF40B467D5
|
||||||
|
email = eduardo.cueto@adaptcentre.ie
|
||||||
|
name = Eduardo Cueto-Mendoza
|
||||||
|
[commit]
|
||||||
|
gpgsign = true
|
||||||
|
[safe]
|
||||||
|
directory = /usr/share/pyenv
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
[core]
|
||||||
|
pager = delta
|
||||||
|
[interactive]
|
||||||
|
diffFilter = delta --color-only
|
||||||
|
[delta]
|
||||||
|
navigate = true # use n and N to move between diff sections
|
||||||
|
side-by-side = true
|
||||||
|
[merge]
|
||||||
|
conflicstyle = diff3
|
||||||
|
[diff]
|
||||||
|
colorMoved = default
|
|
@ -0,0 +1,9 @@
|
||||||
|
._*
|
||||||
|
.gnupg/S.*
|
||||||
|
.gnupg/trustdb.gpg
|
||||||
|
.gnupg/private-keys-v1.d/
|
||||||
|
.gnupg/public-keys.d/
|
||||||
|
.gnupg/random_seed
|
||||||
|
.gnupg/reader_0.status
|
||||||
|
.ssh/known_hosts*
|
||||||
|
.ssh/authorized_keys
|
|
@ -0,0 +1,11 @@
|
||||||
|
\.git
|
||||||
|
\.gitignore
|
||||||
|
\._*
|
||||||
|
\.gnupg/S.*
|
||||||
|
\.gnupg/trustdb.gpg
|
||||||
|
\.gnupg/private-keys-v1.d
|
||||||
|
\.gnupg/public-keys.d
|
||||||
|
\.gnupg/random_seed
|
||||||
|
\.gnupg/reader_0.status
|
||||||
|
\.ssh/known_hosts*
|
||||||
|
\.ssh/authorized_keys
|
|
@ -0,0 +1,53 @@
|
||||||
|
# Neovim required
|
||||||
|
set-option -g focus-events on
|
||||||
|
set-option -a terminal-features 'alacritty:RGB'
|
||||||
|
|
||||||
|
#set -g default-terminal "screen-256color"
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
# Copy as in vim
|
||||||
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||||
|
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
|
||||||
|
|
||||||
|
# remap prefix from 'C-b' to 'C-a'
|
||||||
|
unbind C-b
|
||||||
|
set-option -g prefix C-a
|
||||||
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
|
# split panes using v and f
|
||||||
|
bind v split-window -h
|
||||||
|
bind f split-window -v
|
||||||
|
unbind '"'
|
||||||
|
unbind %
|
||||||
|
|
||||||
|
# reload config file (change file location to your the tmux.conf you want to use)
|
||||||
|
bind r source-file ~/.tmux.conf
|
||||||
|
|
||||||
|
# vi-like keybindings
|
||||||
|
setw -g mode-keys vi
|
||||||
|
bind h select-pane -L
|
||||||
|
bind j select-pane -D
|
||||||
|
bind k select-pane -U
|
||||||
|
bind l select-pane -R
|
||||||
|
|
||||||
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||||
|
bind-key -T copy-mode-vi 'y' send -X copy-selection
|
||||||
|
|
||||||
|
# zenburn theme
|
||||||
|
#setw -g clock-mode-colour colour117
|
||||||
|
#setw -g mode-attr bold
|
||||||
|
#setw -g mode-fg colour117
|
||||||
|
#setw -g mode-bg colour238
|
||||||
|
#set -g status-bg colour235
|
||||||
|
#set -g status-fg colour248
|
||||||
|
#setw -g window-status-current-fg colour223
|
||||||
|
#setw -g window-status-current-bg colour237
|
||||||
|
#setw -g window-status-current-attr bold
|
||||||
|
#set -g message-attr bold
|
||||||
|
#set -g message-fg colour117
|
||||||
|
#set -g message-bg colour235
|
||||||
|
|
||||||
|
# fancy status line: user@host, date, time
|
||||||
|
set-option -g status-right "#(whoami)@#(hostname -s) #[fg=colour187,bold]%a %Y-%m-%d %H:%M"
|
||||||
|
set -g status-right-length 50
|
||||||
|
set -g status-left-length 20
|
Loading…
Reference in New Issue