Skip to content

Instantly share code, notes, and snippets.

@arsaccol
arsaccol / plugins.vim
Created September 30, 2022 13:35
My current neovim plugins configuration
" ====== here lies vim-plug stuff =======
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-fugitive'
Plug 'daskol/nvim-bnf', { 'do': 'go install ./cmd/nvim-bnf' }
Plug 'dracula/vim', {'as': 'dracula'}
Plug 'rust-lang/rust.vim'
Plug 'pangloss/vim-javascript'
Plug 'github/copilot.vim'
Plug 'preservim/nerdtree'
@arsaccol
arsaccol / .tmux.conf
Last active September 1, 2022 17:09
Very comfy tmux
# Blessed C-a instead of C-b
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# press "prefix, r" to reload config
bind r source-file ~/.tmux.conf
# press alt-c to create window
bind -n M-c new-window
@arsaccol
arsaccol / setup_vim_tmux.sh
Last active April 21, 2022 09:04
Hacky-ass script that sets up vim plugins as well as tmux.conf in newly created virtual machines (or actual machines). Might be buggy but will probably improve my quality of life.
#!/bin/bash
echo 'System is' $OSTYPE
# You should install the following packages before running this script (Debian/Ubuntu names here)
# sudo apt install -y git build-essential cmake python3-dev vim tmux
# Also, installing vim-gtk is a good hacky solution to avoid errors where YouCompleteMe says Python is not supported by vim.
echo 'Installing some stuff which may or may not be essential...'
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
@arsaccol
arsaccol / memory-alignment.c
Created May 2, 2021 06:18
Memory alignment demonstration thingie
#include <stddef.h>
#include <stdio.h>
#define STR(x) #x
typedef struct
{
// === funny little waste of memory due to alignment (or lack thereof) ===
// my CPU can only address bytes in multiples of four
// using a non-multiple of 4 number of bytes for the "name" field makes
@arsaccol
arsaccol / init.vim
Created April 21, 2021 05:51
My current neovim config
source ~/.config/nvim/plugins.vim
let mapleader = "-"
set noswapfile
set autoindent
set smartindent
set splitbelow " absolutely
set splitright " blessed
@arsaccol
arsaccol / start-browser-sync.sh
Created January 15, 2021 03:16
Start a browser-sync server where you can develop front-end shit and have it reload automatically in the browser. Use `npm install -g browser-sync` to get it globally installed I guess.
#!/bin/bash
host='localhost'
port=8080
SOCKET_HOST=$host SOCKET_PORT=$port browser-sync start --server --files "./"
@arsaccol
arsaccol / pong.c
Last active July 29, 2020 01:48
Crappy Pong clone for Windows command line I did back in ~2012. Compiled and tested originally with MinGW.
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <time.h>
#include <conio.h>
#include <string.h>
#define PDLMAX 5
#define PDLCTR 9
@arsaccol
arsaccol / settings.json
Created December 12, 2019 23:46
settings.json file for VS Code. Location in Windows is: <user folder>/AppData/Roaming/Code/User/ Location in Ubuntu is: ~/.config/Code/User/
{
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"workbench.iconTheme": "vscode-icons",
"workbench.tree.indent": 16,
"vsicons.dontShowNewVersionMessage": true,
"files.eol": "\n",
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}${separator}${appName}",
"window.menuBarVisibility": "default",
"workbench.sideBar.location": "right",
@arsaccol
arsaccol / .vimrc
Last active August 13, 2019 14:38
macOS .vimrc file. Has setup for Vundle, YCM, NERDTree, Omnisharp. I've followed online instructions so I'm not sure if there are redundant configs or something like that. One thing that I have to fix is C-j and C-k conflicting with some YCM or OmniSharp binding(s).
" Begin Vundle stuff
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Put plugins here
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
@arsaccol
arsaccol / .vimrc
Last active July 16, 2019 13:40
vimrc file I've been using on Windows, putting it here as kind of a backup.
set noswapfile
set autoindent
set smartindent
set splitbelow " absolutely
set splitright " blessed
set tabstop=4
set shiftwidth=4
set expandtab