diff --git a/.zshrc b/.zshrc index 6bafb83..08325b9 100644 --- a/.zshrc +++ b/.zshrc @@ -1,145 +1,150 @@ -#------------------------------------------------------------------# -# File: .zshrc ZSH resource file # -# Version: 0.1.16 # -# Author: Øyvind "Mr.Elendig" Heggstad # -#------------------------------------------------------------------# - -#------------------------------ -# History stuff -#------------------------------ -HISTFILE=~/.histfile -HISTSIZE=1000 -SAVEHIST=1000 - -#------------------------------ -# Variables -#------------------------------ -export EDITOR="vim" -export PAGER="most" -export PATH="${PATH}:${HOME}/bin:${HOME}/.gem/ruby/1.9.1/bin" - -#----------------------------- -# Dircolors -#----------------------------- -LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:'; -export LS_COLORS - -#------------------------------ -# Keybindings -#------------------------------ -bindkey -v -typeset -g -A key -#bindkey '\e[3~' delete-char -bindkey '\e[1~' beginning-of-line -bindkey '\e[4~' end-of-line -#bindkey '\e[2~' overwrite-mode -bindkey '^?' backward-delete-char -bindkey '^[[1~' beginning-of-line -bindkey '^[[5~' up-line-or-history -bindkey '^[[3~' delete-char -bindkey '^[[4~' end-of-line -bindkey '^[[6~' down-line-or-history -bindkey '^[[A' up-line-or-search -bindkey '^[[D' backward-char -bindkey '^[[B' down-line-or-search -bindkey '^[[C' forward-char -# for rxvt -bindkey "\e[8~" end-of-line -bindkey "\e[7~" beginning-of-line -# for gnome-terminal -bindkey "\eOH" beginning-of-line -bindkey "\eOF" end-of-line - -#------------------------------ -# Alias stuff -#------------------------------ -alias ls="ls --color -F" -alias ll="ls --color -lh" -alias spm="sudo pacman" -alias spmc="sudo pacman-color" -alias S="screen" -alias aur="clyde" -alias irb="irb --simple-prompt" -alias S=screen -#------------------------------ -# Comp stuff -#------------------------------ -zmodload zsh/complist -autoload -Uz compinit -compinit -zstyle :compinstall filename '${HOME}/.zshrc' - -#- buggy -zstyle ':completion:*:descriptions' format '%U%B%d%b%u' -zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b' -#-/buggy - -zstyle ':completion:*:pacman:*' force-list always -zstyle ':completion:*:*:pacman:*' menu yes select - -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} - -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:kill:*' force-list always - -zstyle ':completion:*:*:killall:*' menu yes select -zstyle ':completion:*:killall:*' force-list always - -#------------------------------ -# Window title -#------------------------------ -case $TERM in - *xterm*|rxvt|rxvt-unicode|rxvt-256color|(dt|k|E)term) -precmd () { print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a" } -preexec () { print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a" } -;; - screen) - precmd () { -print -Pn "\e]83;title \"$1\"\a" -print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a" +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH + +# Path to your Oh My Zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time Oh My Zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="agnoster" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( +git \ +kubectl \ +autoswitch_virtualenv +) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +eval "$(pyenv init --path)" +export DAGSTER_HOME="${HOME}" +export PATH="/opt/homebrew/opt/libpq/bin:$PATH" + +function login_to_acr { + TOKEN=$(az acr login --name discoverycommon.azurecr.io --expose-token --output tsv --query accessToken); + docker login discoverycommon.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password-stdin <<< $TOKEN; } -preexec () { -print -Pn "\e]83;title \"$1\"\a" -print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a" + +function upload_pip_package { + python3 setup.py sdist upload -r local } -;; -esac - -#------------------------------ -# Prompt -#------------------------------ -setprompt () { -# load some modules -autoload -U colors zsh/terminfo # Used in the colour alias below -colors -setopt prompt_subst - -# make some aliases for the colours: (coud use normal escap.seq's too) -for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do -eval PR_$color='%{$fg[${(L)color}]%}' -done -PR_NO_COLOR="%{$terminfo[sgr0]%}" - -# Check the UID -if [[ $UID -ge 1000 ]]; then # normal user -eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' -eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' -elif [[ $UID -eq 0 ]]; then # root -eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' -eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' -fi - -# Check if we are on SSH or not -if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then -eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH -else -eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH -fi -# set the prompt -PS1=$'${PR_CYAN}[${PR_USER}${PR_CYAN}@${PR_HOST}${PR_CYAN}][${PR_BLUE}%~${PR_CYAN}]${PR_USER_OP} ' -PS2=$'%_>' +function zlib_cat { + local filename=$1; + cat $filename |zlib-flate -uncompress } -setprompt +function list_blob_names { + local account=$1; + local container=$2; + if [ -z $account ];then + echo "missing account"; + return 1; + fi + if [ -z $container ];then + echo "missing container"; + echo "./$0 account container"; + return 1; + fi + az storage blob list --auth-mode login --account-name $account --container-name $container |jq '.[].name' +} +function download_blob { + local account=$1; + local container=$2; + local remote_blob=$3; + local local_file=$4; + az storage blob download --container-name $container --account-name $account --name "$remote_blob" --file "$local_file" --auth-mode login +} +alias vim="nvim" -export TERM="xterm-256color" +export PATH=$HOME/.groundcover/bin:${PATH} diff --git a/README b/README index 2d21feb..a2ade06 100644 --- a/README +++ b/README @@ -1 +1,4 @@ those are my config files, just a backup, move on... move on... + +recommended fond: BlaxMono nerdfont (needs a download) - brew install font-hack-nerd-font (i think) +recommended colorscheme: whimsy from https://github.com/mbadolato/iTerm2-Color-Schemes diff --git a/nvim/.stylua.toml b/nvim/.stylua.toml new file mode 100644 index 0000000..ecb6dca --- /dev/null +++ b/nvim/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/nvim/LICENSE b/nvim/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/nvim/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/nvim/README.md b/nvim/README.md new file mode 100644 index 0000000..dc0deaa --- /dev/null +++ b/nvim/README.md @@ -0,0 +1,9 @@ +**This repo is supposed to used as config by NvChad users!** + +- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo. +- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"` +- So you can delete the .git from this repo ( when you clone it locally ) or fork it :) + +# Credits + +1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier! diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..e3a6efc --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,36 @@ +vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/" +vim.g.mapleader = " " + +-- bootstrap lazy and all plugins +local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" + +if not vim.uv.fs_stat(lazypath) then + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } +end + +vim.opt.rtp:prepend(lazypath) + +local lazy_config = require "configs.lazy" + +-- load plugins +require("lazy").setup({ + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + }, + { import = "plugins" }, +}, lazy_config) + +-- load theme +dofile(vim.g.base46_cache .. "defaults") +dofile(vim.g.base46_cache .. "statusline") + +require "options" +require "nvchad.autocmds" + +vim.schedule(function() + require "mappings" +end) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..cd0fdd4 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,35 @@ +{ + "LuaSnip": { "branch": "master", "commit": "2737edc9e674e537dc0a97e3405658d57d2d31ed" }, + "NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" }, + "base46": { "branch": "v2.5", "commit": "c58d8a76fcd31462ef707c55d9f4147c3927721f" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "d28ccf945374edd9f1c34a82f6c22261dbd8ab98" }, + "crates.nvim": { "branch": "main", "commit": "8bf8358ee326d5d8c11dcd7ac0bcc9ff97dbc785" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" }, + "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" }, + "minty": { "branch": "main", "commit": "1b604ed0d741294cfb56c0ce3aa6161e9ae7dd8b" }, + "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, + "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, + "nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" }, + "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, + "nvim-lspconfig": { "branch": "master", "commit": "d01864641c6e43c681c3e9f6cf4745c75fdd9dcc" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-tree.lua": { "branch": "master", "commit": "c7639482a1598f4756798df1b2d72f79fe5bb34f" }, + "nvim-treesitter": { "branch": "master", "commit": "425b58968340bd5b4621c2a0d626c73556516d3d" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, + "rustaceanvim": { "branch": "master", "commit": "e1f9464d9e1addeccb170eb7968471966965f5a3" }, + "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, + "ui": { "branch": "v3.0", "commit": "b6c237702449792a2d8c495909029fdd59e9781d" }, + "volt": { "branch": "main", "commit": "ff954757fdaf72da0dedd77bdf74718ea846f989" }, + "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" } +} diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua new file mode 100644 index 0000000..bb01462 --- /dev/null +++ b/nvim/lua/chadrc.lua @@ -0,0 +1,17 @@ +-- This file needs to have same structure as nvconfig.lua +-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua +-- Please read that file to know all available options :( + +---@type ChadrcConfig +local M = {} + +M.base46 = { + theme = "jabuti", + + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, +} + +return M diff --git a/nvim/lua/configs/conform.lua b/nvim/lua/configs/conform.lua new file mode 100644 index 0000000..35ba6cf --- /dev/null +++ b/nvim/lua/configs/conform.lua @@ -0,0 +1,15 @@ +local options = { + formatters_by_ft = { + lua = { "stylua" }, + -- css = { "prettier" }, + -- html = { "prettier" }, + }, + + -- format_on_save = { + -- -- These options will be passed to conform.format() + -- timeout_ms = 500, + -- lsp_fallback = true, + -- }, +} + +return options diff --git a/nvim/lua/configs/lazy.lua b/nvim/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/nvim/lua/configs/lazy.lua @@ -0,0 +1,47 @@ +return { + defaults = { lazy = true }, + install = { colorscheme = { "nvchad" } }, + + ui = { + icons = { + ft = "", + lazy = "󰂠 ", + loaded = "", + not_loaded = "", + }, + }, + + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "tohtml", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", + }, + }, + }, +} diff --git a/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua new file mode 100644 index 0000000..42a7792 --- /dev/null +++ b/nvim/lua/configs/lspconfig.lua @@ -0,0 +1,32 @@ +-- load defaults i.e lua_lsp +require("nvchad.configs.lspconfig").defaults() + +local lspconfig = require "lspconfig" + +-- EXAMPLE +local nvlsp = require "nvchad.configs.lspconfig" +local util = require "lspconfig/util" + +-- lsps with default config +--lspconfig.rust_analyzer.setup { +-- on_attach = nvlsp.on_attach, +-- on_init = nvlsp.on_init, +-- capabilities = nvlsp.capabilities, +-- filetypes = {"rust"}, +-- root_dir = util.root_pattern("Cargo.toml"), +-- settings = { +-- ['rust-analyzer'] = { +-- cargo = { +-- allFeatures = true +-- } +-- } +-- } +-- } + +-- configuring single server, example: typescript +-- lspconfig.ts_ls.setup { +-- on_attach = nvlsp.on_attach, +-- on_init = nvlsp.on_init, +-- capabilities = nvlsp.capabilities, +-- } + diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua new file mode 100644 index 0000000..88c6534 --- /dev/null +++ b/nvim/lua/mappings.lua @@ -0,0 +1,30 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") + + +-- map({ "n", "i", "v" }, "", " w ") +-- + +-- Nvim DAP +map("n", "dl", "lua require'dap'.step_into()", { desc = "Debugger step into" }) +map("n", "dj", "lua require'dap'.step_over()", { desc = "Debugger step over" }) +map("n", "dk", "lua require'dap'.step_out()", { desc = "Debugger step out" }) +map("n", "dc", "lua require'dap'.continue()", { desc = "Debugger continue" }) +map("n", "db", "lua require'dap'.toggle_breakpoint()", { desc = "Debugger toggle breakpoint" }) +map( + "n", + "dd", + "lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))", + { desc = "Debugger set conditional breakpoint" } +) +map("n", "de", "lua require'dap'.terminate()", { desc = "Debugger reset" }) +map("n", "dr", "lua require'dap'.run_last()", { desc = "Debugger run last" }) + +-- rustaceanvim +map("n", "dt", "lua vim.cmd('RustLsp testables')", { desc = "Debugger testables" }) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua new file mode 100644 index 0000000..738f20b --- /dev/null +++ b/nvim/lua/options.lua @@ -0,0 +1,6 @@ +require "nvchad.options" + +-- add yours here! + +-- local o = vim.o +-- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..c68d644 --- /dev/null +++ b/nvim/lua/plugins/init.lua @@ -0,0 +1,97 @@ +return { + { + "stevearc/conform.nvim", + -- event = 'BufWritePre', -- uncomment for format on save + opts = require "configs.conform", + }, + -- These are some examples, uncomment them if you want to see them work! + { + "neovim/nvim-lspconfig", + config = function() + require "configs.lspconfig" + end, + }, + { + 'mrcjkb/rustaceanvim', + version = '^5', -- Recommended + lazy = false, -- This plugin is already lazy + ft = "rust", + config = function () + local mason_registry = require('mason-registry') + local codelldb = mason_registry.get_package("codelldb") + local extension_path = codelldb:get_install_path() .. "/extension/" + local codelldb_path = extension_path .. "adapter/codelldb" + local liblldb_path = extension_path.. "lldb/lib/liblldb.dylib" + -- If you are on Linux, replace the line above with the line below: + -- local liblldb_path = extension_path .. "lldb/lib/liblldb.so" + local cfg = require('rustaceanvim.config') + + vim.g.rustaceanvim = { + dap = { + adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path), + }, + } + end + }, + + { + 'rust-lang/rust.vim', + ft = "rust", + init = function () + vim.g.rustfmt_autosave = 1 + end + }, + + { + 'mfussenegger/nvim-dap', + config = function() + local dap, dapui = require("dap"), require("dapui") + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + end, + }, + + { + 'rcarriga/nvim-dap-ui', + dependencies = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"}, + config = function() + require("dapui").setup() + end, + }, + + { + 'saecki/crates.nvim', + ft = {"toml"}, + config = function() + require("crates").setup { + completion = { + cmp = { + enabled = true + }, + }, + } + require('cmp').setup.buffer({ + sources = { { name = "crates" }} + }) + end + }, + -- { + -- "nvim-treesitter/nvim-treesitter", + -- opts = { + -- ensure_installed = { + -- "vim", "lua", "vimdoc", + -- "html", "css" + -- }, + -- }, + -- }, +}