From efb531383dd7c0b0a2ae53aecbae2fec9053a809 Mon Sep 17 00:00:00 2001 From: Xavier Moffett Date: Thu, 24 Oct 2024 22:40:03 -0400 Subject: [PATCH] Initial commit --- .gitignore | 2 + README.md | 6 ++ alacritty/alacritty.toml | 84 +++++++++++++++++++++++++++ alacritty/alacritty.yml | 100 +++++++++++++++++++++++++++++++++ fontconfig/fonts.conf | 48 ++++++++++++++++ nvim/init.vim | 28 +++++++++ nvim/lua/config/bindings.lua | 13 +++++ nvim/lua/config/editor.lua | 21 +++++++ nvim/lua/config/lsp.lua | 72 ++++++++++++++++++++++++ nvim/lua/config/telescope.lua | 15 +++++ nvim/lua/config/theme.lua | 29 ++++++++++ nvim/lua/config/treesitter.lua | 24 ++++++++ nvim/lua/plugins.lua | 67 ++++++++++++++++++++++ tmux/tmux.conf | 16 ++++++ 14 files changed, 525 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 alacritty/alacritty.toml create mode 100644 alacritty/alacritty.yml create mode 100644 fontconfig/fonts.conf create mode 100644 nvim/init.vim create mode 100644 nvim/lua/config/bindings.lua create mode 100644 nvim/lua/config/editor.lua create mode 100644 nvim/lua/config/lsp.lua create mode 100644 nvim/lua/config/telescope.lua create mode 100644 nvim/lua/config/theme.lua create mode 100644 nvim/lua/config/treesitter.lua create mode 100644 nvim/lua/plugins.lua create mode 100644 tmux/tmux.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b46626 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/nvim/plugin/* +/nvim/lua/plugin/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..86745dc --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# dotfiles + +Some dotfiles of mine that I use. Feel free to critique my font choice, though don't be too harsh. :P +With the exception of fonts, keeping it simple stupid is the name of the game here. Too large of a deviation +from defaults is undesirable, usually making things more needlessly complex in both workflow and configuration; +which is undesirable at large. This also ensures a lesser overall maintenance burden. diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml new file mode 100644 index 0000000..e5acff0 --- /dev/null +++ b/alacritty/alacritty.toml @@ -0,0 +1,84 @@ +live_config_reload = true + +[bell.command] +args = ["/usr/share/sounds/freedesktop/stereo/dialog-warning.oga"] +program = "paplay" + +[colors] +draw_bold_text_with_bright_colors = true + +[colors.bright] +black = "0x5b5858" +blue = "0x3fc4de" +cyan = "0x6be4e6" +green = "0x3fdaa4" +magenta = "0xf075b5" +red = "0xec6a88" +white = "0xd5d8da" +yellow = "0xfbc3a7" + +[colors.normal] +black = "0x16161c" +blue = "0x26bbd9" +cyan = "0x59e1e3" +green = "0x29d398" +magenta = "0xee64ac" +red = "0xe95678" +white = "0xd5d8da" +yellow = "0xfab795" + +[colors.primary] +background = "#000000" +foreground = "#FFFFFF" + +[cursor] +blink_interval = 300 +thickness = 0.25 +unfocused_hollow = false +vi_mode_style = "Beam" + +[cursor.style] +blinking = "Always" +shape = "Underline" + +[env] +LANG = "en_CA.UTF-8" +LC_ALL = "en_CA.UTF-8" +TERM = "alacritty" + +[font] +size = 8.5 + +[font.bold] +family = "Dina" + +[font.bold_italic] +family = "Dina" + +[font.italic] +family = "Dina" + +[font.normal] +family = "Dina" + +[font.offset] +x = 0 +y = 0 + +[scrolling] +history = 0 +multiplier = 3 + +[selection] +save_to_clipboard = true + +[window] +dynamic_padding = true +dynamic_title = true +opacity = 0.7 +startup_mode = "Windowed" +title = "Terminal" + +[window.dimensions] +columns = 130 +lines = 25 diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml new file mode 100644 index 0000000..c22d156 --- /dev/null +++ b/alacritty/alacritty.yml @@ -0,0 +1,100 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. +# sapphirus@sapphirus.org - 2021-2023 + +env: + TERM: alacritty + LC_ALL: "en_CA.UTF-8" + LANG: "en_CA.UTF-8" + +window: + dimensions: + columns: 130 + lines: 25 + + dynamic_padding: true + startup_mode: Windowed + title: Terminal + dynamic_title: true + #gtk_theme_variant: None + opacity: 0.7 + +scrolling: + history: 0 + multiplier: 3 + +font: + normal: + family: Dina + bold: + family: Dina + italic: + family: Dina + bold_italic: + family: Dina + + size: 9 + offset: + x: 0 + y: 0 + +draw_bold_text_with_bright_colors: true + + +# Colors (Horizon Dark) +colors: +# Primary colors + primary: + background: '#000000' + foreground: '#FFFFFF' + + # Normal colors + normal: + black: '0x16161c' + red: '0xe95678' + green: '0x29d398' + yellow: '0xfab795' + blue: '0x26bbd9' + magenta: '0xee64ac' + cyan: '0x59e1e3' + white: '0xd5d8da' + + # Bright colors + bright: + black: '0x5b5858' + red: '0xec6a88' + green: '0x3fdaa4' + yellow: '0xfbc3a7' + blue: '0x3fc4de' + magenta: '0xf075b5' + cyan: '0x6be4e6' + white: '0xd5d8da' + + transparent_background_colors: true + + +# Bell +bell: + #animation: EaseOutSine + #duration: 400 + #color: '#093d9e' + command: + program: paplay + args: ["/usr/share/sounds/freedesktop/stereo/dialog-warning.oga"] + +selection: + save_to_clipboard: true + +cursor: + style: + shape: Underline + blinking: Always + vi_mode_style: Beam + blink_interval: 300 + unfocused_hollow: false + thickness: 0.25 +live_config_reload: true + +#shell: +# program: /bin/bash +# args: +# - --login diff --git a/fontconfig/fonts.conf b/fontconfig/fonts.conf new file mode 100644 index 0000000..1dda57d --- /dev/null +++ b/fontconfig/fonts.conf @@ -0,0 +1,48 @@ + + + + + Dina + + Dina + Monospace + Inconsolata + twemoji + Noto Color Emoji + + + + + none + + + true + + + true + + + true + + + hintslight + + + lcdlight + + + + + Dina + + + false + + + false + + + false + + + diff --git a/nvim/init.vim b/nvim/init.vim new file mode 100644 index 0000000..777a985 --- /dev/null +++ b/nvim/init.vim @@ -0,0 +1,28 @@ +lua require('plugins') +lua require('telescope') +lua require('config.bindings') +lua require('config.telescope') +lua require('config.treesitter') +lua require('config.lsp') +lua require('config.editor') +lua require('config.theme') + +set guicursor= +set autoindent +set wildmode=longest,list +set laststatus=0 +set clipboard+=unnamedplus +set background=dark +set number +set hidden +set title +set signcolumn=yes:1 + +filetype plugin on +filetype indent on + +colorscheme carbonfox + +hi Normal ctermbg=NONE guibg=NONE +hi SignColumn ctermbg=NONE guibg=NONE +hi LineNr ctermbg=NONE guibg=none guifg=Grey diff --git a/nvim/lua/config/bindings.lua b/nvim/lua/config/bindings.lua new file mode 100644 index 0000000..428042c --- /dev/null +++ b/nvim/lua/config/bindings.lua @@ -0,0 +1,13 @@ +vim.g.mapleader = " " + +vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) +vim.keymap.set("n", "sy", vim.cmd.PackerSync) +vim.keymap.set("n", "ty", vim.cmd.TSUpdate) +vim.keymap.set("n", "o", "Neotree") +vim.keymap.set("n", "t", "Neotree toggle") +vim.keymap.set("n", "p", "bp") +vim.keymap.set("n", "q", "bd") +vim.keymap.set("n", "l", "bl") +vim.keymap.set("n", "lb", "VGit toggle_live_blame") +vim.keymap.set("n", "bp", "VGit buffer_blame_preview") diff --git a/nvim/lua/config/editor.lua b/nvim/lua/config/editor.lua new file mode 100644 index 0000000..9aad10f --- /dev/null +++ b/nvim/lua/config/editor.lua @@ -0,0 +1,21 @@ +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.opt.smartindent = true +vim.opt.nu = false +vim.opt.relativenumber = true +vim.opt.wrap = false +vim.opt.termguicolors = true +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undofile = true + +vim.g.moonflyNormalFloat = true +vim.g.moonflyTransparent = true +vim.g.moonflyUndercurls = false + +vim.o.updatetime = 300 +vim.o.incsearch = false + +vim.lsp.buf.signature_help = true diff --git a/nvim/lua/config/lsp.lua b/nvim/lua/config/lsp.lua new file mode 100644 index 0000000..05fb341 --- /dev/null +++ b/nvim/lua/config/lsp.lua @@ -0,0 +1,72 @@ +local lsp = require("lsp-zero") +local git = require("vgit") +local sig = require("lsp_signature") +local cmp = require("cmp") +local cmp_action = require("lsp-zero").cmp_action() + +lsp.preset("recommended") + +require('mason').setup({}) +require('mason-lspconfig').setup({ + ensure_installed = {'rust_analyzer'}, + handlers = { + lsp.default_setup, + }, +}) + +cmp.setup({ + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp_action.luasnip_jump_backward(), + [''] = cmp_action.luasnip_jump_forward(), + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.complete(), + }) +}) + +lsp.set_preferences({ + sign_icons = { } +}) + +lsp.set_sign_icons({ + error = '', + warn = '', + hint = '', + info = '', +}) + +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr, remap = false} + + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.lps.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set("n", "vca", function() vim.diagnostic.code_action() end, opts) + vim.keymap.set("n", "vrr", function() vim.diagnostic.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.diagnostic.rename() end, opts) + vim.keymap.set("n", "", function() vim.diagnostic.signature_help() end, opts) +end) + + +lsp.setup() +-- sig.setup({ +-- hint_enable = false, +-- fix_pos = , +-- always_trigger = true, +-- handler_opts = { +-- border = "rounded" -- double, rounded, single, shadow, none, or a table of borders +-- }, +--}) +git.setup({ + settings = { + signs = { + priority = 0, + }, + } +}) diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua new file mode 100644 index 0000000..45e8765 --- /dev/null +++ b/nvim/lua/config/telescope.lua @@ -0,0 +1,15 @@ +local builtin = require('telescope.builtin') + +vim.keymap.set('n', 'f', builtin.find_files, {}) +vim.keymap.set('n', 'g', builtin.live_grep, {}) +vim.keymap.set('n', 'b', builtin.buffers, {}) + +require('telescope').setup{ + defaults = { + file_ignore_patterns = { + "target", + "dist/runtime", + "dist/filesystem", + } + } +} diff --git a/nvim/lua/config/theme.lua b/nvim/lua/config/theme.lua new file mode 100644 index 0000000..becea10 --- /dev/null +++ b/nvim/lua/config/theme.lua @@ -0,0 +1,29 @@ +require('nightfox').setup({ + options = { + transparent = true, -- Disable setting background + terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` + dim_inactive = false, -- Non focused panes set to alternative background + module_default = true, -- Default enable value for modules + }, + palettes = { + all = { -- Normal terminal colour scheme + black = "#16161c", + blue = "#26bbd9", + cyan = "#59e1e3", + green = "#29d398", + magenta = "#ee64ac", + red = "#e95678", + white = "#d5d8da", + orange = "#fab795", + yellow = "#fbc3a7", + }, + }, + specs = { + all = { + syntax = { + builtin0 = "blue.bright", + comment = "white.dim", + }, + }, + }, +}) diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua new file mode 100644 index 0000000..d1abf80 --- /dev/null +++ b/nvim/lua/config/treesitter.lua @@ -0,0 +1,24 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query" , "rust" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + highlight = { + enable = true, + + -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- the name of the parser) + -- list of language that will be disabled + additional_vim_regex_highlighting = true, + }, +} diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua new file mode 100644 index 0000000..df7988d --- /dev/null +++ b/nvim/lua/plugins.lua @@ -0,0 +1,67 @@ +-- This file can be loaded by calling `lua require('plugins')` from your init.vim + +-- Only required if you have packer configured as `opt` +vim.cmd [[packadd packer.nvim]] + +return require('packer').startup(function(use) + -- Packer can manage itself + use('wbthomason/packer.nvim') + + + use('olimorris/onedarkpro.nvim') + use('EdenEast/nightfox.nvim') + use('nvim-tree/nvim-web-devicons') + + use('nvim-treesitter/playground'); + use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) + + use('mbbill/undotree') + + use('williamboman/mason.nvim') + use('williamboman/mason-lspconfig.nvim') + + + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.5', + requires = { {'nvim-lua/plenary.nvim'} } + } + + use { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + requires = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + } + } + + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + requires = { + --- Uncomment the two plugins below if you want to manage the language servers from neovim + -- {'williamboman/mason.nvim'}, + -- {'williamboman/mason-lspconfig.nvim'}, + + -- LSP Support + {'neovim/nvim-lspconfig'}, + -- Autocompletion + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'L3MON4D3/LuaSnip'}, + } + } + + use { + "ray-x/lsp_signature.nvim", + } + + use { + 'tanvirtin/vgit.nvim', + requires = { + 'nvim-lua/plenary.nvim' + } + } +end) diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..488170d --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,16 @@ +unbind C-b +bind-key k clear-history + +set -g prefix C-s +set -g status off +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",alacritty:RGB" + +set-environment -g "LC_ALL" "en_CA.UTF-8" +set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins/' + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +run '~/.local/share/tmux/plugins/tpm/tpm'