Browse Source

Tue 19 Jul 2022 18:13:10 ACST

master
Tovi Jaeschke-Rogers 2 years ago
parent
commit
48f5d6906f
7 changed files with 10 additions and 125 deletions
  1. +1
    -1
      .config/aliasrc
  2. +0
    -33
      .config/nvim/lua/autocmd.lua
  3. +0
    -30
      .config/nvim/lua/options.lua
  4. +0
    -25
      .config/nvim/lua/packer-plugins.lua
  5. +0
    -35
      .config/nvim/lua/remaps.lua
  6. +5
    -0
      .zshrc
  7. +4
    -1
      update.sh

+ 1
- 1
.config/aliasrc View File

@ -12,7 +12,7 @@ alias \
gitup='git push origin $(git rev-parse --abbrev-ref HEAD)' \ gitup='git push origin $(git rev-parse --abbrev-ref HEAD)' \
gco='git checkout' \ gco='git checkout' \
gbls='git --no-pager branch -a' \ gbls='git --no-pager branch -a' \
vv='nvim ~/.config/nvim/init.vim' \
vv='nvim ~/.config/nvim/init.lua' \
vz='nvim ~/.zshrc && source ~/.zshrc' \ vz='nvim ~/.zshrc && source ~/.zshrc' \
va='nvim ~/.config/aliasrc && source ~/.zshrc' \ va='nvim ~/.config/aliasrc && source ~/.zshrc' \
sz='source ~/.zshrc' \ sz='source ~/.zshrc' \


+ 0
- 33
.config/nvim/lua/autocmd.lua View File

@ -1,33 +0,0 @@
-- Remove any trailing whitespace from the file on write
vim.api.nvim_create_autocmd({ 'BufWritePre' }, { command = [[%s/\s\+$//e]] })
-- Load file on last line
-- TODO: change this to use lua
vim.api.nvim_create_autocmd({ 'BufRead' }, {
command = [[if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif]]
})
-- Save session on VimLeave
vim.api.nvim_create_autocmd({ 'VimLeave' }, {
command = [[mksession! ~/.config/nvim/session/shutdown_session.vim]]
})
-- Set tabs to 2 for dart, vue, and js files
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = { '*.dart', '*.vue', '*.js' },
callback = function()
vim.o.tabstop = 2
vim.o.softtabstop = 2
vim.o.shiftwidth = 2
end
})
-- Ensure to read .docker files as a dockerfile
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = { '*.docker' },
callback = function()
vim.o.syntax = 'dockerfile'
end
})

+ 0
- 30
.config/nvim/lua/options.lua View File

@ -1,30 +0,0 @@
vim.g.mapleader = ','
vim.o.clipboard = 'unnamedplus'
vim.o.nohlsearch = true
vim.o.incsearch = true
vim.o.ignorecase = true
-- autocmd BufWritePre * :%s/\s\+$//e
vim.o.mouse = 'a'
vim.o.smartcase = true
vim.o.linebreak = true
vim.o.noswapfile = true
vim.o.nobackup = true
vim.o.undodir = vim.fn.expand('~/.config/nvim/undodir')
vim.o.undofile = true
vim.o.encoding = 'utf-8'
vim.o.number = true
vim.o.relativenumber = true
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.expandtab = true
vim.o.shiftwidth = 4
vim.o.smarttab = true
vim.o.formatoptions = 'tqj'

+ 0
- 25
.config/nvim/lua/packer-plugins.lua View File

@ -1,25 +0,0 @@
return require('packer').startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- colorscheme
use 'gruvbox-community/gruvbox'
use { 'neoclide/coc.nvim', run = 'yarn install' }
use 'nvim-lua/popup.nvim'
use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim'
use 'nvim-telescope/telescope-fzy-native.nvim'
use 'Rican7/php-doc-modded'
use 'f-person/git-blame.nvim'
use 'dart-lang/dart-vim-plugin'
use { 'fatih/vim-go', cmd = 'GoUpdateBinaries' }
use { 'darrikonn/vim-gofmt', cmd = 'GoUpdateBinaries' }
use 'aserowy/tmux.nvim'
end)

+ 0
- 35
.config/nvim/lua/remaps.lua View File

@ -1,35 +0,0 @@
local options = { noremap = true }
vim.api.nvim_set_keymap('n', 'c', '"_c', options)
-- Easily open splits
vim.api.nvim_set_keymap('n', '<leader>hs', '<cmd>split<cr>', options)
vim.api.nvim_set_keymap('n', '<leader>vs', '<cmd>vsplit<cr>', options)
-- Copy the entire file
vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options)
-- Easily navigate tabs
vim.api.nvim_set_keymap('n', '<leader>1', '1gt', options)
vim.api.nvim_set_keymap('n', '<leader>2', '2gt', options)
vim.api.nvim_set_keymap('n', '<leader>3', '3gt', options)
vim.api.nvim_set_keymap('n', '<leader>4', '4gt', options)
vim.api.nvim_set_keymap('n', '<leader>5', '5gt', options)
-- Manually store session
vim.api.nvim_set_keymap('n', '<F5>', '<cmd>mksession! ~/.config/nvim/session/manual_session.vim<cr>', options)
-- Restore manually stored session
vim.api.nvim_set_keymap('n', '<F6>', '<cmd>source ~/.config/nvim/session/manual_session.vim<cr>', options)
-- Restore auto saved session created on exit
vim.api.nvim_set_keymap('n', '<F7>', '<cmd>source ~/.config/nvim/session/shutdown_session.vim<CR>', options)
-- Replace all is aliased to S.
vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options)
-- Navigating with guides
vim.api.nvim_set_keymap('n', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
vim.api.nvim_set_keymap('i', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
vim.api.nvim_set_keymap('v', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
-- Spell-check
vim.api.nvim_set_keymap('n', '<leader>o', '<cmd>setlocal spell! spelllang=en_au<cr>', options)

+ 5
- 0
.zshrc View File

@ -208,6 +208,11 @@ export QT_QPA_PLATFORMTHEME="qt5ct"
# exec tmux # exec tmux
#fi #fi
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export ANDROID_SDK_ROOT='/opt/android-sdk' export ANDROID_SDK_ROOT='/opt/android-sdk'
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/ export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin/ export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin/


+ 4
- 1
update.sh View File

@ -10,7 +10,10 @@ declare -a FILES=(
.xinitrc .xinitrc
.config/aliasrc .config/aliasrc
.config/nvim/init.lua .config/nvim/init.lua
.config/nvim/lua/general
.config/nvim/lua/general/remaps.lua
.config/nvim/lua/general/options.lua
.config/nvim/lua/general/autocmd.lua
.config/nvim/lua/helper/toggle-tab-width.lua
.config/nvim/plugin .config/nvim/plugin
.config/nvim/lua/packer-plugins.lua .config/nvim/lua/packer-plugins.lua
.config/nvim/coc-settings.json .config/nvim/coc-settings.json


Loading…
Cancel
Save