Compare commits

...

6 Commits

@ -17,8 +17,8 @@ setopt prompt_subst
zstyle ':vcs_info:git:*' formats '%b' zstyle ':vcs_info:git:*' formats '%b'
# prompt configs # prompt configs
RPROMPT='${vcs_info_msg_0_}' # RPROMPT='${vcs_info_msg_0_}'
PROMPT='%F{green}%n@%m %~ ▷%f ' PROMPT='%F{#99ad6a}%~ %(1j.%F{#adadad}[%j]%f .)%F{#99ad6a}▷%f '
# history stuff # history stuff
export HISTFILE=~/.zsh_history export HISTFILE=~/.zsh_history

@ -27,7 +27,7 @@ repo: https://github.com/yegappan/lsp
target: ~/.vim/pack/downloads/opt/lsp target: ~/.vim/pack/downloads/opt/lsp
[home vim] [home vim]
when: host.has('vim') or host.has('nvim') when: host.has('vim')
files: files:
vim/ftplugin > .vim/ftplugin vim/ftplugin > .vim/ftplugin
vim/plug.vim > .vim/autoload/plug.vim vim/plug.vim > .vim/autoload/plug.vim
@ -65,30 +65,29 @@ files:
when: host.has('vim') when: host.has('vim')
cmd: vim +PlugInstall +qall cmd: vim +PlugInstall +qall
[link-files neovim:windows] # [link-files neovim:windows]
when: host.is_windows and host.has('nvim') # when: host.is_windows and host.has('nvim')
target_root: ~/AppData/Local # target_root: ~/AppData/Local
files: # files:
nvim/lua # nvim/lua
nvim/init.vim # nvim/init.vim
[link-files neovim:linux] [home neovim:not-windows]
when: host.is_linux and host.has('nvim') when: host.has('nvim') and not host.is_windows
target_root: ~/.config
files: files:
nvim/colors nvim/init.lua > .config/nvim/init.lua
nvim/lua nvim/lua > .config/nvim/lua
nvim/init.vim nvim/after > .config/nvim/after
[git packer-posix] [git packer-posix]
when: not host.is_windows when: not host.is_windows
repo: https://github.com/wbthomason/packer.nvim repo: https://github.com/wbthomason/packer.nvim
target: ~/.local/share/nvim/site/pack/packer/start/packer.nvim target: ~/.local/share/nvim/site/pack/packer/start/packer.nvim
[git packer-windows] # [git packer-windows]
when: host.is_windows # when: host.is_windows
repo: https://github.com/wbthomason/packer.nvim # repo: https://github.com/wbthomason/packer.nvim
target: ~/AppData/Local/nvim-data/site/pack/packer/start/packer.nvim # target: ~/AppData/Local/nvim-data/site/pack/packer/start/packer.nvim
[home cargo] [home cargo]
when: host.has('cargo') when: host.has('cargo')
@ -115,9 +114,9 @@ files: .screenrc
when: host.has('tmux') when: host.has('tmux')
files: .tmux.conf files: .tmux.conf
[home posix-nvim] # [home posix-nvim]
when: host.has('nvim') and not host.is_windows # when: host.has('nvim') and not host.is_windows
files: nvim/init.vim > .config/nvim/init.vim # files: nvim/init.vim > .config/nvim/init.vim
[home wsl] [home wsl]
when: host.is_wsl when: host.is_wsl
@ -137,10 +136,12 @@ files: k9s/skin.yml > .config/k9s/skin.yml
crates: crates:
just just
cargo-watch cargo-watch
# this one isn't working on MacOS
# cargo-edit
cargo-get cargo-get
# this one requires libssl but we don't install that here so it doesn't
# always work
# cargo-edit
[link-files gitui:linux] [link-files gitui:linux]
when: host.is_linux and host.has('gitui') when: host.is_linux and host.has('gitui')
target_root: ~/.config target_root: ~/.config

@ -1422,7 +1422,7 @@ tab_bar_min_tabs 2
#: in the path are expanded. Changing this option by reloading the #: in the path are expanded. Changing this option by reloading the
#: config is not supported. #: config is not supported.
# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask
#: Allow programs running in kitty to read and write from the #: Allow programs running in kitty to read and write from the
#: clipboard. You can control exactly which actions are allowed. The #: clipboard. You can control exactly which actions are allowed. The

@ -0,0 +1 @@
print("You are in Python")

@ -0,0 +1,15 @@
print("Setting up colors")
rose_pine = packer_plugins["rose-pine"]
if rose_pine then
print("Rose Pine is known")
if rose_pine.loaded then
print("Using Rose Pine colorscheme")
vim.cmd.colorscheme("rose-pine")
-- vim.cmd("colorscheme rose-pine")
else
print("Rose Pine is not loaded")
end
else
print("Rose Pine is not known")
end

@ -0,0 +1,47 @@
print("Configuring gitsigns")
local gitsigns = require('gitsigns')
gitsigns.setup {
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
auto_attach = true,
attach_to_untracked = false,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
virt_text_priority = 100,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
current_line_blame_formatter_opts = {
relative_time = false,
},
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
}

@ -0,0 +1 @@
print("LSP setting up")

@ -0,0 +1,2 @@
print("After Telescope")
local builtin = require('telescope.builtin')

@ -0,0 +1,19 @@
require("nvim-tree").setup({
git = { enable = false },
renderer = {
icons = {
show = {
folder_arrow = false
},
glyphs = {
default = "",
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
}
},
}
}
})

@ -0,0 +1,63 @@
print("Configuring Treesitter")
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = {
"c",
"c_sharp",
"cmake",
"cpp",
"css",
"diff",
"dockerfile",
"elixir",
"go",
"graphql",
"hcl",
"javascript",
"lua",
"nix",
"proto",
"python",
"query",
"ruby",
"rust",
"toml",
"typescript",
"vim",
"vimdoc",
"yaml",
"zig",
},
-- Install parsers asynchronously
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,
-- List of parsers to ignore installing (or "all")
ignore_install = { },
highlight = {
enable = true,
-- Disable treesitter on super large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}

@ -0,0 +1,17 @@
print("Init start")
-- set leader to space
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
-- for some reason vim-tree needs this to happen very early on and no I do not
-- know why
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("plugins")
require("prefs")
require("keys")

@ -0,0 +1,12 @@
print("Loading key mappings")
local telescope = require('telescope.builtin')
vim.keymap.set('n', '<C-p>', telescope.find_files, {})
-- vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
-- vim.keymap.set("v", "K", ":m '>-2<CR>gv=gv")
-- using J to join lines doesn't move your cursor
-- vim.keymap.set("n", "J", "mzJ`z")
-- vim.keymap.set('n', '<C-k'

@ -1,17 +1,54 @@
function packer_startup(use) print("Loading plugins")
-- Packer can manage itself
vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function(use)
-- the plugin that manages the plugins
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
-- lsp manager -- this thing finds files or something
use 'neovim/nvim-lspconfig' use {
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
requires = {
{'nvim-lua/plenary.nvim'}
}
}
-- parses code
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
-- lets you look at parse trees
use { 'nvim-treesitter/playground' }
-- it's a colorscheme
use { "rose-pine/neovim", as = "rose-pine" }
-- hmmmm try this?
-- https://github.com/ThePrimeagen/harpoon/tree/harpoon2
-- visualizes vim's undo tree
use { "mbbill/undotree" }
-- a git client
use { "tpope/vim-fugitive" }
use {"akinsho/toggleterm.nvim", tag = "*", config = function() -- show git status per-line in a gutter column
require("toggleterm").setup() use {
end} "lewis6991/gitsigns.nvim"
end }
require('packer').startup(packer_startup) -- a file browser
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
use { "nvim-tree/nvim-tree.lua" }
require('lspconfig').rust_analyzer.setup({}) -- helps you configure lsp servers
use {
"neovim/nvim-lspconfig"
}
end)
require("toggleterm").setup{}

@ -0,0 +1,86 @@
print("Applying Preferences")
-- The character coding used within vim. I don't remember why I set this, to be
-- honest.
vim.opt.encoding = "utf-8"
-- allow backspacing overl ine breaks
vim.opt.backspace = "indent,eol,start"
-- copy indent from current line when starting a new line
vim.opt.autoindent = true
-- automatically add an indent after block-opening symbols like {
vim.opt.smartindent = true
-- tab characters are 4
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
-- indent with 4 spaces when creating automatic indents
vim.opt.shiftwidth = 4
-- expand tab characters to spaces
vim.opt.expandtab = true
-- configure the characters used to show whitespace characters
vim.opt.listchars = {
tab = "",
trail = "·",
precedes = "",
extends = "",
}
-- show whitespace characters by default
vim.opt.list = true
-- perform searches incrementally
vim.opt.incsearch = true
-- use case-insensitive searching unless we see a capital
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- highlight recently searched term
vim.opt.hlsearch = true
-- line numbering on
vim.opt.nu = true
-- wrap long lines
vim.opt.wrap = true
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undoing"
vim.opt.undofile = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 4
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
-- Enable mouse mode
vim.opt.mouse = 'a'
-- do not show the mode, it is in the status line
vim.opt.showmode = false
-- use the operating system clipboard for the default yank register
-- vim.opt.clipboard = 'unnamedplus'
-- direction of new open splits
vim.opt.splitright = true
vim.opt.splitbelow = true
-- double-tap escape to exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', {
desc = 'Exit terminal mode'
})
-- set the cwd of the buffer to the directory of the buffer's file
-- when entering a buffer.
vim.opt.autochdir = true

@ -0,0 +1,17 @@
function packer_startup(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- lsp manager
use 'neovim/nvim-lspconfig'
use {"akinsho/toggleterm.nvim", tag = "*", config = function()
require("toggleterm").setup()
end}
end
require('packer').startup(packer_startup)
require('lspconfig').rust_analyzer.setup({})
require("toggleterm").setup{}

@ -1,4 +1,5 @@
set expandtab set expandtab
set shiftwidth=2 set shiftwidth=2
set tabstop=2 set tabstop=2
let b:ale_fix_on_save = 1
" set omnifunc=ale#completion#OmniFunc " set omnifunc=ale#completion#OmniFunc

@ -1,4 +1,6 @@
let g:rustfmt_autosave = 1 let b:rustfmt_autosave = 1
let b:ale_rust_cargo_use_clippy = 1
let b:ale_fix_on_save = 1
nmap <F5> :Cargo run<CR> nmap <F5> :Cargo run<CR>
nmap <F7> :Cargo check<CR> nmap <F7> :Cargo check<CR>

18
vimrc

@ -10,6 +10,9 @@ if has('nvim') && has('win32')
endif endif
call plug#begin() call plug#begin()
if !has('nvim')
Plug 'dense-analysis/ale' " just for linting this time around
endif
Plug 'tpope/vim-fugitive' " integration with the git cli Plug 'tpope/vim-fugitive' " integration with the git cli
Plug 'tpope/vim-surround' " edits surrounding quotes and parens and the like Plug 'tpope/vim-surround' " edits surrounding quotes and parens and the like
Plug 'tpope/vim-rails' " rails project management stuff Plug 'tpope/vim-rails' " rails project management stuff
@ -22,6 +25,7 @@ call plug#begin()
Plug 'fatih/vim-hclfmt' " nicely formats hcl files Plug 'fatih/vim-hclfmt' " nicely formats hcl files
Plug 'nanotech/jellybeans.vim' " the best colorscheme Plug 'nanotech/jellybeans.vim' " the best colorscheme
Plug 'ervandew/supertab' " makes tab better apparently Plug 'ervandew/supertab' " makes tab better apparently
Plug 'NoahTheDuke/vim-just' " justfiles
Plug 'scrooloose/nerdcommenter' " no idea if I'm even using this Plug 'scrooloose/nerdcommenter' " no idea if I'm even using this
Plug 'ctrlpvim/ctrlp.vim' " don't actually know how to use this honestly Plug 'ctrlpvim/ctrlp.vim' " don't actually know how to use this honestly
Plug 'itchyny/lightline.vim' " fancy status line Plug 'itchyny/lightline.vim' " fancy status line
@ -533,10 +537,16 @@ nmap <S-M> :LspDiagCurrent<CR>
" ALE -----------------------------------------------------------------------{{{ " ALE -----------------------------------------------------------------------{{{
if !has('nvim') if !has('nvim')
let g:ale_linters = {'rust': ['analyzer']} let g:ale_linters = {
let g:ale_fixers = {'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines']} \ 'rust': ['analyzer'],
let g:ale_rust_cargo_use_clippy = 1 \ 'python': ['ruff']
let g:ale_completion_enabled = 1 \ }
let g:ale_fixers = {
\ 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'],
\ 'python': ['ruff_format', 'reorder-python-imports']
\ }
" we're not using ALE for Autocomplete because we're using lsp instead
let g:ale_completion_enabled = 0
set completeopt=menu,menuone,preview,noselect,noinsert set completeopt=menu,menuone,preview,noselect,noinsert
endif endif
" ---------------------------------------------------------------------------}}} " ---------------------------------------------------------------------------}}}

Loading…
Cancel
Save