From 20edc7dc7e2a22b29ee8214d0440726be5281e85 Mon Sep 17 00:00:00 2001 From: Scott Carroll Date: Sun, 30 Mar 2025 12:20:24 +0100 Subject: [PATCH] first commit --- base/.config/btop/btop.conf | 245 ++++++++++++++++++ base/.config/htop/htoprc | 61 +++++ base/.config/starship.toml | 241 +++++++++++++++++ base/.gitconfig | 7 + base/.tmux.conf | 16 ++ bashprofile/.bashrc | 131 ++++++++++ bashprofile/.profile | 27 ++ nvim/.config/nvim/init.lua | 78 ++++++ nvim/.config/nvim/lazy-lock.json | 14 + nvim/.config/nvim/lua/config/lazy.lua | 35 +++ nvim/.config/nvim/lua/plugins/blink.lua | 53 ++++ nvim/.config/nvim/lua/plugins/colorscheme.lua | 10 + nvim/.config/nvim/lua/plugins/lsp_lines.lua | 8 + nvim/.config/nvim/lua/plugins/marks.lua | 7 + nvim/.config/nvim/lua/plugins/mason.lua | 7 + .../nvim/lua/plugins/nvim-lspconfig.lua | 35 +++ nvim/.config/nvim/lua/plugins/telescope.lua | 5 + nvim/.config/nvim/lua/plugins/treesitter.lua | 22 ++ nvim/.config/nvim/lua/plugins/undotree.lua | 5 + 19 files changed, 1007 insertions(+) create mode 100644 base/.config/btop/btop.conf create mode 100644 base/.config/htop/htoprc create mode 100644 base/.config/starship.toml create mode 100644 base/.gitconfig create mode 100644 base/.tmux.conf create mode 100644 bashprofile/.bashrc create mode 100644 bashprofile/.profile create mode 100644 nvim/.config/nvim/init.lua create mode 100644 nvim/.config/nvim/lazy-lock.json create mode 100644 nvim/.config/nvim/lua/config/lazy.lua create mode 100644 nvim/.config/nvim/lua/plugins/blink.lua create mode 100644 nvim/.config/nvim/lua/plugins/colorscheme.lua create mode 100644 nvim/.config/nvim/lua/plugins/lsp_lines.lua create mode 100644 nvim/.config/nvim/lua/plugins/marks.lua create mode 100644 nvim/.config/nvim/lua/plugins/mason.lua create mode 100644 nvim/.config/nvim/lua/plugins/nvim-lspconfig.lua create mode 100644 nvim/.config/nvim/lua/plugins/telescope.lua create mode 100644 nvim/.config/nvim/lua/plugins/treesitter.lua create mode 100644 nvim/.config/nvim/lua/plugins/undotree.lua diff --git a/base/.config/btop/btop.conf b/base/.config/btop/btop.conf new file mode 100644 index 0000000..e7dc17f --- /dev/null +++ b/base/.config/btop/btop.conf @@ -0,0 +1,245 @@ +#? Config file for btop v. 1.3.0 + +#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. +#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" +color_theme = "Default" + +#* If the theme set background should be shown, set to False if you want terminal background transparency. +theme_background = True + +#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. +truecolor = True + +#* Set to true to force tty mode regardless if a real tty has been detected or not. +#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. +force_tty = False + +#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. +#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. +#* Use whitespace " " as separator between different presets. +#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" + +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = False + +#* Rounded corners on boxes, is ignored if TTY mode is ON. +rounded_corners = True + +#* Default symbols to use for graph creation, "braille", "block" or "tty". +#* "braille" offers the highest resolution but might not be included in all fonts. +#* "block" has half the resolution of braille but uses more common characters. +#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. +#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. +graph_symbol = "braille" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_cpu = "default" + +# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty". +graph_symbol_gpu = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_mem = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_net = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_proc = "default" + +#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. +shown_boxes = "mem net proc cpu" + +#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. +update_ms = 2000 + +#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", +#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. +proc_sorting = "cpu lazy" + +#* Reverse sorting order, True or False. +proc_reversed = False + +#* Show processes as a tree. +proc_tree = False + +#* Use the cpu graph colors in the process list. +proc_colors = True + +#* Use a darkening gradient in the process list. +proc_gradient = True + +#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. +proc_per_core = False + +#* Show process memory as bytes instead of percent. +proc_mem_bytes = True + +#* Show cpu graph for each process. +proc_cpu_graphs = True + +#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) +proc_info_smaps = False + +#* Show proc box on left side of screen instead of right. +proc_left = False + +#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). +proc_filter_kernel = False + +#* In tree-view, always accumulate child process resources in the parent process. +proc_aggregate = False + +#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_upper = "Auto" + +#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_lower = "Auto" + +#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off". +show_gpu_info = "Auto" + +#* Toggles if the lower CPU graph should be inverted. +cpu_invert_lower = True + +#* Set to True to completely disable the lower CPU graph. +cpu_single_graph = False + +#* Show cpu box at bottom of screen instead of top. +cpu_bottom = False + +#* Shows the system uptime in the CPU box. +show_uptime = True + +#* Show cpu temperature. +check_temp = True + +#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. +cpu_sensor = "Auto" + +#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. +show_coretemp = True + +#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. +#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. +#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. +#* Example: "4:0 5:1 6:3" +cpu_core_map = "" + +#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". +temp_scale = "celsius" + +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = False + +#* Show CPU frequency. +show_cpu_freq = True + +#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. +#* Special formatting: /host = hostname | /user = username | /uptime = system uptime +clock_format = "%X" + +#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. +background_update = True + +#* Custom cpu model name, empty string to disable. +custom_cpu_name = "" + +#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". +#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user". +disks_filter = "" + +#* Show graphs instead of meters for memory values. +mem_graphs = True + +#* Show mem box below net box instead of above. +mem_below_net = False + +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = True + +#* If swap memory should be shown in memory box. +show_swap = True + +#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. +swap_disk = True + +#* If mem box should be split to also show disks info. +show_disks = True + +#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. +only_physical = True + +#* Read disks list from /etc/fstab. This also disables only_physical. +use_fstab = True + +#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) +zfs_hide_datasets = False + +#* Set to true to show available disk space for privileged users. +disk_free_priv = False + +#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. +show_io_stat = True + +#* Toggles io mode for disks, showing big graphs for disk read/write speeds. +io_mode = True + +#* Set to True to show combined read/write io graphs in io mode. +io_graph_combined = False + +#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". +#* Example: "/mnt/media:100 /:20 /boot:1". +io_graph_speeds = "" + +#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. +net_download = 100 + +net_upload = 100 + +#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. +net_auto = True + +#* Sync the auto scaling for download and upload to whichever currently has the highest scale. +net_sync = True + +#* Starts with the Network Interface specified here. +net_iface = "" + +#* Show battery stats in top right if battery is present. +show_battery = False + +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + +#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. +log_level = "WARNING" + +#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. +nvml_measure_pcie_speeds = True + +#* Horizontally mirror the GPU graph. +gpu_mirror_graph = True + +#* Custom gpu0 model name, empty string to disable. +custom_gpu_name0 = "" + +#* Custom gpu1 model name, empty string to disable. +custom_gpu_name1 = "" + +#* Custom gpu2 model name, empty string to disable. +custom_gpu_name2 = "" + +#* Custom gpu3 model name, empty string to disable. +custom_gpu_name3 = "" + +#* Custom gpu4 model name, empty string to disable. +custom_gpu_name4 = "" + +#* Custom gpu5 model name, empty string to disable. +custom_gpu_name5 = "" \ No newline at end of file diff --git a/base/.config/htop/htoprc b/base/.config/htop/htoprc new file mode 100644 index 0000000..800e77b --- /dev/null +++ b/base/.config/htop/htoprc @@ -0,0 +1,61 @@ +# Beware! This file is rewritten by htop when settings are changed in the interface. +# The parser is also very primitive, and not human-friendly. +htop_version=3.2.1 +config_reader_min_version=3 +fields=0 48 17 18 38 39 40 2 46 47 49 1 +hide_kernel_threads=1 +hide_userland_threads=0 +shadow_other_users=0 +show_thread_names=0 +show_program_path=1 +highlight_base_name=0 +highlight_deleted_exe=1 +highlight_megabytes=1 +highlight_threads=1 +highlight_changes=0 +highlight_changes_delay_secs=5 +find_comm_in_cmdline=1 +strip_exe_from_cmdline=1 +show_merged_command=0 +header_margin=1 +screen_tabs=1 +detailed_cpu_time=0 +cpu_count_from_one=0 +show_cpu_usage=1 +show_cpu_frequency=0 +show_cpu_temperature=0 +degree_fahrenheit=0 +update_process_names=0 +account_guest_in_cpu_meter=0 +color_scheme=0 +enable_mouse=1 +delay=15 +hide_function_bar=0 +header_layout=two_50_50 +column_meters_0=AllCPUs Memory Swap +column_meter_modes_0=1 1 1 +column_meters_1=Tasks LoadAverage Uptime +column_meter_modes_1=2 2 2 +tree_view=0 +sort_key=46 +tree_sort_key=0 +sort_direction=-1 +tree_sort_direction=1 +tree_view_always_by_pid=0 +all_branches_collapsed=0 +screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command +.sort_key=PERCENT_CPU +.tree_sort_key=PID +.tree_view=0 +.tree_view_always_by_pid=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 +screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command +.sort_key=IO_RATE +.tree_sort_key=PID +.tree_view=0 +.tree_view_always_by_pid=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 diff --git a/base/.config/starship.toml b/base/.config/starship.toml new file mode 100644 index 0000000..e997ac6 --- /dev/null +++ b/base/.config/starship.toml @@ -0,0 +1,241 @@ +[hostname] +ssh_only = false + +[line_break] +disabled = false + +[character] +success_symbol = "[>](bold green)" +error_symbol = "[x](bold red)" +vimcmd_symbol = "[<](bold green)" + +[git_commit] +tag_symbol = " tag " + +[git_status] +ahead = ">" +behind = "<" +diverged = "<>" +renamed = "r" +deleted = "x" + +[aws] +symbol = "aws " + +[azure] +symbol = "az " + +[bun] +symbol = "bun " + +[c] +symbol = "C " + +[cobol] +symbol = "cobol " + +[conda] +symbol = "conda " + +[crystal] +symbol = "cr " + +[cmake] +symbol = "cmake " + +[daml] +symbol = "daml " + +[dart] +symbol = "dart " + +[deno] +symbol = "deno " + +[dotnet] +symbol = ".NET " + +[directory] +read_only = " ro" + +[docker_context] +symbol = "docker " + +[elixir] +symbol = "exs " + +[elm] +symbol = "elm " + +[fennel] +symbol = "fnl " + +[fossil_branch] +symbol = "fossil " + +[gcloud] +symbol = "gcp " + +[git_branch] +symbol = "git " + +[gleam] +symbol = "gleam " + +[golang] +symbol = "go " + +[gradle] +symbol = "gradle " + +[guix_shell] +symbol = "guix " + +[hg_branch] +symbol = "hg " + +[java] +symbol = "java " + +[julia] +symbol = "jl " + +[kotlin] +symbol = "kt " + +[lua] +symbol = "lua " + +[nodejs] +symbol = "nodejs " + +[memory_usage] +symbol = "memory " + +[meson] +symbol = "meson " + +[nats] +symbol = "nats " + +[nim] +symbol = "nim " + +[nix_shell] +symbol = "nix " + +[ocaml] +symbol = "ml " + +[opa] +symbol = "opa " + +[os.symbols] +AIX = "aix " +Alpaquita = "alq " +AlmaLinux = "alma " +Alpine = "alp " +Amazon = "amz " +Android = "andr " +Arch = "rch " +Artix = "atx " +CentOS = "cent " +Debian = "deb " +DragonFly = "dfbsd " +Emscripten = "emsc " +EndeavourOS = "ndev " +Fedora = "fed " +FreeBSD = "fbsd " +Garuda = "garu " +Gentoo = "gent " +HardenedBSD = "hbsd " +Illumos = "lum " +Kali = "kali " +Linux = "lnx " +Mabox = "mbox " +Macos = "mac " +Manjaro = "mjo " +Mariner = "mrn " +MidnightBSD = "mid " +Mint = "mint " +NetBSD = "nbsd " +NixOS = "nix " +OpenBSD = "obsd " +OpenCloudOS = "ocos " +openEuler = "oeul " +openSUSE = "osuse " +OracleLinux = "orac " +Pop = "pop " +Raspbian = "rasp " +Redhat = "rhl " +RedHatEnterprise = "rhel " +RockyLinux = "rky " +Redox = "redox " +Solus = "sol " +SUSE = "suse " +Ubuntu = "ubnt " +Ultramarine = "ultm " +Unknown = "unk " +Void = "void " +Windows = "win " + +[package] +symbol = "pkg " + +[perl] +symbol = "pl " + +[php] +symbol = "php " + +[pijul_channel] +symbol = "pijul " + +[pulumi] +symbol = "pulumi " + +[purescript] +symbol = "purs " + +[python] +symbol = "py " + +[quarto] +symbol = "quarto " + +[raku] +symbol = "raku " + +[ruby] +symbol = "rb " + +[rust] +symbol = "rs " + +[scala] +symbol = "scala " + +[spack] +symbol = "spack " + +[solidity] +symbol = "solidity " + +[status] +symbol = "[x](bold red) " + +[sudo] +symbol = "sudo " +disabled = false + +[swift] +symbol = "swift " + +[typst] +symbol = "typst " + +[terraform] +symbol = "terraform " + +[zig] +symbol = "zig " diff --git a/base/.gitconfig b/base/.gitconfig new file mode 100644 index 0000000..9ffabdb --- /dev/null +++ b/base/.gitconfig @@ -0,0 +1,7 @@ +[user] + name = Scott Carroll + email = scottc@scottc.net +[init] + defaultBranch = main +[safe] + directory = /mailu diff --git a/base/.tmux.conf b/base/.tmux.conf new file mode 100644 index 0000000..df2876c --- /dev/null +++ b/base/.tmux.conf @@ -0,0 +1,16 @@ +set-option -g prefix C-space + +set -g mouse off +setw -g mouse off + +# Start windows and panes at 1, not 0 +set -g base-index 1 +setw -g pane-base-index 1 + +set -g allow-passthrough on + +bind-key -n F2 new-window +bind-key -n F3 previous-window +bind-key -n F4 next-window + +set -s set-clipboard on diff --git a/bashprofile/.bashrc b/bashprofile/.bashrc new file mode 100644 index 0000000..690db7f --- /dev/null +++ b/bashprofile/.bashrc @@ -0,0 +1,131 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +eval "$(starship init bash)" + +#if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then +# exec tmux +#fi + +# tmux attach-session -t default || tmux new-session -s default + + +if command -v tmux>/dev/null; then + [ -z "$TMUX" ] && tmux new-session -A -s default +fi + diff --git a/bashprofile/.profile b/bashprofile/.profile new file mode 100644 index 0000000..d89ea5a --- /dev/null +++ b/bashprofile/.profile @@ -0,0 +1,27 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..aee5e0d --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,78 @@ +require("config.lazy") + +vim.opt.mouse = '' +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.rnu = true + +-- length of an actual \t character: +vim.opt.tabstop=2 +-- length to use when editing text (eg. TAB and BS keys) +-- (0 for 'tabstop', -1 for 'shiftwidth'): +vim.opt.softtabstop=-1 +-- length to use when shifting text (eg. <<, >> and == commands) +-- (0 for 'tabstop'): +vim.opt.shiftwidth=0 +-- round indentation to multiples of 'shiftwidth' when shifting text +-- (so that it behaves like Ctrl-D / Ctrl-T): +vim.opt.shiftround = true + +-- if set, only insert spaces; otherwise insert \t and complete with spaces: +vim.opt.expandtab = true + +-- reproduce the indentation of the previous line: +vim.opt.autoindent = true +-- keep indentation produced by 'autoindent' if leaving the line blank: +-- vim.opt.cpoptions+=I +-- try to be smart (increase the indenting level after '{', +-- decrease it after '}', and so on): +vim.opt.smartindent = true +-- a stricter alternative which works better for the C language: +vim.opt.cindent = true + +-- keep cursor away from the top and bottom of the screen +vim.opt.scrolloff = 6 + +-- marker at line 80 +vim.opt.colorcolumn = "80" + +-- use language-specific plugins for indenting (better): +vim.cmd("filetype plugin indent on") +vim.cmd("syntax on") + +vim.keymap.set('n', 'p', 'pu') + +vim.g.mapleader = " " +vim.keymap.set("n", "ll", vim.cmd.Ex) + +-- Telescope +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) +vim.keymap.set('n', 'fg', builtin.git_files, { desc = 'Telescope find git files' }) +vim.keymap.set('n', 'fG', function() + builtin.grep_string({ search = vim.fn.input("grep > ") } ); +end ) + +-- UndoTree +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +-- Reserve a space in the gutter +vim.opt.signcolumn = 'yes' + +-- move paragraphs +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- cut to system clipboard +vim.keymap.set("n", "y", "\"+y") +vim.keymap.set("v", "y", "\"+y") +vim.keymap.set("n", "Y", "\"+Y") + +-- Diagnostics +vim.diagnostic.config({ + virtual_text = false, +}) +vim.diagnostic.config({ virtual_lines = true }) + diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..2b34217 --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,14 @@ +{ + "blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" }, + "dracula.nvim": { "branch": "main", "commit": "96c9d19ce81b26053055ad6f688277d655b3f7d2" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" }, + "marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "nvim-lspconfig": { "branch": "master", "commit": "0a1ac55d7d4ec2b2ed9616dfc5406791234d1d2b" }, + "nvim-treesitter": { "branch": "master", "commit": "aece1062335a9e856636f5da12d8a06c7615ce8a" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" } +} diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua new file mode 100644 index 0000000..4191abe --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/blink.lua @@ -0,0 +1,53 @@ +return { + 'saghen/blink.cmp', + -- optional: provides snippets for the snippet source + dependencies = { 'rafamadriz/friendly-snippets' }, + + -- use a release tag to download pre-built binaries + version = '1.*', + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { preset = 'super-tab' }, + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono' + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { documentation = { auto_show = true } }, + + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" } + }, + opts_extend = { "sources.default" } +} diff --git a/nvim/.config/nvim/lua/plugins/colorscheme.lua b/nvim/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..326ad6a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,10 @@ +return { + { + "Mofiqul/dracula.nvim", + lazy = false, -- make sure we load this during startup if it is your main colorscheme + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + vim.cmd([[colorscheme dracula]]) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/lsp_lines.lua b/nvim/.config/nvim/lua/plugins/lsp_lines.lua new file mode 100644 index 0000000..887671e --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lsp_lines.lua @@ -0,0 +1,8 @@ +return { + { + "https://git.sr.ht/~whynothugo/lsp_lines.nvim", + config = function() + require("lsp_lines").setup() + end, + } +} diff --git a/nvim/.config/nvim/lua/plugins/marks.lua b/nvim/.config/nvim/lua/plugins/marks.lua new file mode 100644 index 0000000..326b36d --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/marks.lua @@ -0,0 +1,7 @@ +return { + { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/mason.lua b/nvim/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..140e86d --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,7 @@ +return { + { + 'williamboman/mason.nvim', + lazy = false, + opts = {}, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/.config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..bb7962a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,35 @@ +return { + { + 'neovim/nvim-lspconfig', + dependencies = { 'saghen/blink.cmp' }, + + opts = { + servers = { + lua_ls = { + autostart = true, + settings = { + Lua = { + diagnostics = { globals = {'vim'} } + } + }, + }, + markdown_oxide = {}, + terraformls = {}, + superhtml = {}, + pyright = {}, + taplo = {}, + bashls = {}, + html = {}, + } + }, + config = function(_, opts) + local lspconfig = require('lspconfig') + for server, config in pairs(opts.servers) do + -- passing config.capabilities to blink.cmp merges with the capabilities in your + -- `opts[server].capabilities, if you've defined it + config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities) + lspconfig[server].setup(config) + end + end + } + } diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..018a3b8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,5 @@ +return { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + -- or , branch = '0.1.x', + dependencies = { 'nvim-lua/plenary.nvim' } +} diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..1e3f7c3 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,22 @@ +local opts = { + ensure_installed = { + 'c', + 'lua', + 'vim', + 'vimdoc', + 'query', + 'markdown', + 'markdown_inline', + }, +} + +local function config() + require('nvim-treesitter.configs').setup(opts) +end + +return { + 'nvim-treesitter/nvim-treesitter', + config = config, + build = ':TSUpdate' +} + diff --git a/nvim/.config/nvim/lua/plugins/undotree.lua b/nvim/.config/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..0300021 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/undotree.lua @@ -0,0 +1,5 @@ +return { + { + "mbbill/undotree" + } +}