diff options
| -rw-r--r-- | vimrc | 98 | ||||
| -rw-r--r-- | zshrc | 92 |
2 files changed, 79 insertions, 111 deletions
@@ -1,15 +1,3 @@ -set autoindent expandtab tabstop=2 shiftwidth=2 number -set mouse=a -set mousemodel=popup -set noshowmode -set termguicolors -set title -set smartcase -set showtabline=2 -set nocompatible -set signcolumn=no -filetype plugin on - let g:mapleader = '\' let g:vsnip_snippet_dir = '~/.config/nvim/snippets' @@ -26,9 +14,7 @@ lua <<EOF Plug('hrsh7th/nvim-cmp') Plug('itchyny/lightline.vim') Plug('mengelbrecht/lightline-bufferline') - Plug('shawnohare/hadalized.nvim') Plug('preservim/nerdtree') - Plug('bignimbus/pop-punk.vim') Plug('nvim-treesitter/nvim-treesitter', { ['do'] = ':TSUpdate' }) Plug('nvim-lua/plenary.nvim') Plug('nvim-telescope/telescope.nvim', { tag = '0.1.8' }) @@ -297,6 +283,18 @@ lua <<EOF }) EOF + +set autoindent expandtab tabstop=2 shiftwidth=2 number +set mouse=a +set mousemodel=popup +set noshowmode +set termguicolors +set title +set smartcase +set showtabline=2 +set nocompatible +set signcolumn=no +filetype plugin on let g:vimspector_enable_mappings = 'HUMAN' let g:vimspector_enable_debug_logging = 0 let g:lightline = { @@ -332,6 +330,7 @@ let g:lightline.component_raw = {'buffers': 1} let g:lightline#bufferline#clickable = 1 let g:lightline#bufferline#show_number = 2 +let g:zig_fmt_autosave=0 let g:ale_javascript_eslint_options = '--config /home/aurelia/.eslintrc.json' function! CustomTabs() @@ -394,11 +393,7 @@ function! SWB() endfunction function! SW() - if winnr('$') > 1 - wincmd w - else - execute('call lightline#bufferline#go_next()') - endif + execute('call lightline#bufferline#go_next()') endfunction function! Q() @@ -406,9 +401,7 @@ function! Q() NERDTreeClose else call feedkeys(":nohlsearch\<CR>") - if winnr('$') > 1 - close - elseif len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) > 1 + if len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) > 1 call feedkeys(':bd') else call feedkeys(':q') @@ -433,6 +426,60 @@ function! TurnOffCDiag() endif endfunction +function! AddSpacesToParentheses() range + let saved_search = @/ + let pattern = '\v(\w+\()(\S.{-})(\))' + execute a:firstline . ',' . a:lastline . 's/' . pattern . '/\1 \2 \3/ge' + execute a:firstline . ',' . a:lastline . 's/( )/( )/ge' + execute a:firstline . ',' . a:lastline . 's/(\s\+/( /ge' + execute a:firstline . ',' . a:lastline . 's/\s\+)/ )/ge' + let @/ = saved_search +endfunction + +function! OpenLsp() + let float_visible = 0 + for win in range(1, winnr('$')) + let config = nvim_win_get_config(win_getid(win)) + if has_key(config, 'relative') && config.relative != '' + let float_visible = 1 + break + endif + endfor + + if !float_visible + lua vim.lsp.buf.hover() + endif +endfunction + +function! OpenFloat() + let float_visible = 0 + for win in range(1, winnr('$')) + let config = nvim_win_get_config(win_getid(win)) + if has_key(config, 'relative') && config.relative != '' + let float_visible = 1 + break + endif + endfor + + if !float_visible + lua vim.diagnostic.open_float(nil, {focus=false}) + endif + + for win in range(1, winnr('$')) + let config = nvim_win_get_config(win_getid(win)) + if has_key(config, 'relative') && config.relative != '' + let float_visible = 1 + break + endif + endfor + + if !float_visible + lua vim.lsp.buf.hover() + endif +endfunction + +vnoremap <leader>ap :call AddSpacesToParentheses()<CR> + autocmd BufReadPost * call TurnOffCDiag() nnoremap <C-e> :NERDTree<CR> @@ -479,14 +526,15 @@ vnoremap <S-Tab> <gv nnoremap <leader><left> <Plug>lightline#bufferline#move_previous() nnoremap <leader><right> <Plug>lightline#bufferline#move_next() -nnoremap f <cmd>lua vim.diagnostic.open_float()<CR> +nnoremap f :call OpenFloat()<CR> +nnoremap <leader>f :call OpenLsp()<CR> colorscheme base16-synth-midnight-dark hi LineNr guibg=#000000 hi String ctermfg=1 guifg=#ea5971 hi Character ctermfg=1 guifg=#dddddd hi CmpItemKindDefault guifg=#7cede9 guibg=#101010 -hi javaScriptIdentifier guifg=#ff40ff ctermfg=Blue +hi javaScriptIdentifier guifg=#ff40ff ctermfg=Magenta hi Delimiter ctermfg=14 guifg=#cccccc hi AvanteConflictCurrent guibg=#101010 hi AvanteConflictIncoming guibg=#102010 @@ -496,6 +544,7 @@ hi @variable guifg=#40FF40 ctermfg=Green hi Identifier guifg=#27ea91 hi def link @lsp.typemod.variable.defaultLibrary.javascript Special hi def link @punctuation.special.javascript Delimiter +hi def link @lsp.type.keywordLiteral.zig Special hi @type.builtin.cpp guifg=#ea5ce2 hi SpecialChar ctermfg=9 guifg=#e4600e @@ -505,6 +554,7 @@ let g:indentLine_color_term=239 let g:indentLine_color_gui='#141414' let NERDTreeQuitOnOpen=1 +autocmd BufNewFile,BufRead *.zig set shiftwidth=2 autocmd BufNewFile,BufRead *.modelfile set ft=gotmpl aunmenu PopUp.How-to\ disable\ mouse @@ -1,75 +1,14 @@ -# If you come from bash you might have to change your $PATH. -export PATH=$HOME/bin:/usr/local/bin:/home/aurelia/.cargo/bin:$PATH +export PATH=$HOME/bin:/usr/local/bin:$HOME/.cargo/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="evan" - -# 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" +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 zsh-syntax-highlighting @@ -89,44 +28,23 @@ alias mpa="mpv --no-video" alias l='ls' alias lg='lazygit' -alias gpt='node "/media/aurelia/sda0 [dev]/gpt.js"' export ANDROID_HOME=/media/aurelia/data/android-projects -# export MANPATH="/usr/local/man:$MANPATH" +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='nvim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# 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 the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" +export ARCHFLAGS="-arch x86_64" OLLAMA_HOME="/media/aurelia/dev/ollama" OLLAMA_MODELS="/media/aurelia/dev/ollama/models" export OLLAMA_HOME export OLLAMA_MODELS -EMSDK_QUIET=1 source /home/aurelia/code/emsdk/emsdk_env.sh +EMSDK_QUIET=1 source $HOME/code/emsdk/emsdk_env.sh # The next line updates PATH for the Google Cloud SDK. if [ -f '/home/aurelia/google-cloud-sdk/path.zsh.inc' ]; then . '/home/aurelia/google-cloud-sdk/path.zsh.inc'; fi - # The next line enables shell command completion for gcloud. if [ -f '/home/aurelia/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/aurelia/google-cloud-sdk/completion.zsh.inc'; fi |
