Skip to content

Instantly share code, notes, and snippets.

@mustardfrog
Last active July 21, 2021 13:13
Show Gist options
  • Select an option

  • Save mustardfrog/9d48078b218ceb096ae961dca3e76df1 to your computer and use it in GitHub Desktop.

Select an option

Save mustardfrog/9d48078b218ceb096ae961dca3e76df1 to your computer and use it in GitHub Desktop.

Revisions

  1. mustardfrog revised this gist Jul 21, 2021. 1 changed file with 88 additions and 0 deletions.
    88 changes: 88 additions & 0 deletions .Xresources
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,88 @@
    URxvt*inheritPixmap: true
    URxvt*transparent: true
    URxvt*shading: 40
    URxvt*termName: rxvt
    !URxvt.font: xft:Courier:size=12:style=Oblique
    URxvt.font: xft:MesloLGS NF:size=12
    !!URxvt.font: 9x15

    !!urxvt*depth: 20
    !!urxvt*background: rgba:0000/0000/0200/c800

    ! special
    *.foreground: #f8f8f2
    *.background: #272822
    *.cursorColor: #f3f3f3

    ! black
    *.color0: #272822
    *.color8: #75715e

    ! red
    *.color1: #f92672
    *.color9: #f92672

    ! green
    *.color2: #a6e22e
    *.color10: #a6e22e

    ! yellow
    *.color3: #f4bf75
    *.color11: #f4bf75

    ! blue
    *.color4: #66d9ef
    *.color12: #66d9ef

    ! magenta
    *.color5: #ae81ff
    *.color13: #ae81ff

    ! cyan
    *.color6: #a1efe4
    *.color14: #a1efe4

    ! white
    *.color7: #f8f8f2
    *.color15: #f9f8f5

    URxvt.keysym.Shift-Control-V: eval:paste_clipboard
    URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard

    !URxvt.perl-ext-common: selection-to-clipboard


    URxvt.letterSpace: 0
    URxvt.lineSpace: 0
    URxvt.geometry: 92x24
    URxvt.internalBorder: 15
    URxvt.cursorBlink: false
    URxvt.cursorUnderline: false
    URxvt.saveline: 2048
    URxvt.scrollBar: false
    URxvt.scrollBar_right: false
    URxvt.urgentOnBell: true
    URxvt.depth: 20
    URxvt.iso14755: false

    !! Common Keybinds for Navigations
    URxvt.keysym.Shift-Up: command:\033]720;1\007
    URxvt.keysym.Shift-Down: command:\033]721;1\007
    URxvt.keysym.Control-Up: \033[1;5A
    URxvt.keysym.Control-Down: \033[1;5B
    URxvt.keysym.Control-Right: \033[1;5C
    URxvt.keysym.Control-Left: \033[1;5D

    !! Copy Paste & Other Extensions
    URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
    URxvt.copyCommand: xclip -i -selection clipboard
    URxvt.pasteCommand: xclip -o -selection clipboard
    URxvt.keysym.M-c: perl:clipboard:copy
    URxvt.keysym.M-v: perl:clipboard:paste
    URxvt.keysym.M-C-v: perl:clipboard:paste_escaped
    URxvt.keysym.M-Escape: perl:keyboard-select:activate
    URxvt.keysym.M-s: perl:keyboard-select:search
    URxvt.keysym.M-u: perl:url-select:select_next
    URxvt.urlLauncher: firefox
    URxvt.underlineURLs: true
    URxvt.urlButton: 1
  2. mustardfrog created this gist Jul 17, 2021.
    248 changes: 248 additions & 0 deletions rustinit.vim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,248 @@
    set exrc
    set nohlsearch
    set ruler
    set number
    set relativenumber
    set tabstop=4 softtabstop=4
    "set smartindent
    set shiftwidth=4
    set expandtab
    set hidden
    set nobackup
    set noerrorbells
    set wrap
    set incsearch
    set scrolloff=8
    set cmdheight=2
    set updatetime=300
    set shortmess+=c
    set bg=dark
    set t_Co=256
    let g:fugitive_dynamic_colors = 256
    set mouse=nvi
    set guicursor=i:blinkon175,n:blinkoff0
    "set guicursor=
    set termguicolors
    "vno y "*y
    set signcolumn=yes
    "noremap pp :r !pbpaste<CR>
    set completeopt=menuone,noinsert,noselect
    set updatetime=300

    syntax enable
    filetype plugin indent on
    vnoremap J :m '>+1<CR>gv=gv
    vnoremap K :m '<-2<CR>gv=gv
    vmap <C-c> y:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR>
    call plug#begin('~/.vim/plugged')
    "Plug 'scrooloose/nerdtree'
    Plug 'ThePrimeagen/vim-be-good'
    Plug 'mattn/emmet-vim'
    "Plug 'neoclide/coc.nvim', {'branch': 'release'}
    Plug 'morhetz/gruvbox'
    Plug 'dracula/vim', {'as': 'dracula'}
    Plug 'ayu-theme/ayu-vim'
    Plug 'ryanoasis/vim-devicons'
    "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
    Plug 'junegunn/fzf.vim'
    Plug 'stsewd/fzf-checkout.vim'
    Plug 'airblade/vim-rooter'

    Plug 'nvim-lua/popup.nvim'
    Plug 'nvim-lua/plenary.nvim'
    Plug 'nvim-telescope/telescope.nvim'

    Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
    Plug 'nvim-treesitter/playground'

    Plug 'kyazdani42/nvim-tree.lua'

    "Plug 'christoomey/vim-tmux-navigator'
    Plug 'preservim/nerdcommenter'

    Plug 'tpope/vim-fugitive'
    Plug 'vim-airline/vim-airline'

    Plug 'pangloss/vim-javascript'
    Plug 'mxw/vim-jsx'
    Plug 'vim-ruby/vim-ruby'
    Plug 'neovim/nvim-lspconfig'
    " Extensions to built-in LSP, for example, providing type inlay hints
    Plug 'nvim-lua/lsp_extensions.nvim'
    " Adds extra functionality over rust analyzer
    Plug 'simrat39/rust-tools.nvim'

    " Autocompletion framework for built-in LSP
    "Plug 'nvim-lua/completion-nvim'
    Plug 'hrsh7th/nvim-compe'

    Plug 'windwp/nvim-autopairs'

    call plug#end()
    colorscheme gruvbox
    " Use completion-nvim in every buffer
    "autocmd BufEnter * lua require'completion'.on_attach()


    let g:completion_enable_auto_hover = 0
    let g:completion_enable_auto_signature = 0
    "let g:completion_trigger_character = ['.', '::']

    " use <Tab> as trigger keys
    imap <Tab> <Plug>(completion_smart_tab)
    imap <S-Tab> <Plug>(completion_smart_s_tab)
    let g:gruvbox_contrast_dark = "hard"
    if exists(+'termguicolor')
    let &t_8f = "/<Esc>[38;2;%lu;%lu;%lum"
    let &t_8b = "/<Esc>[48;2;%lu;%lu;%lum"
    endif
    let g:gruvbox_invert_selection='0'
    let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
    let g:gruvbox_transparent_bg = 1
    "let g:gruvbox_number_column =

    "let ayucolor="dark"

    "let g:netrw_browse_split = 2
    let g:netrw_banner = 0
    let g:netrw_liststyle = 3

    """"treesitter
    lua <<EOF
    require'nvim-treesitter.configs'.setup {
    highlight = {
    enable = true
    },
    playground = {
    enable = true,
    disable = {},
    updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
    persist_queries = false -- Whether the query persists across vim sessions
    }
    }
    EOF
    "Configure lsp
    "https://github.com/neovim/nvim-lspconfig#rust_analyzer

    lua <<EOF

    -- nvim_lsp object
    local nvim_lsp = require'lspconfig'

    local opts = {
    tools = {
    autoSetHints = true,
    hover_with_actions = true,
    runnables = {
    use_telescope = true
    },
    inlay_hints = {
    show_parameter_hints = false,
    parameter_hints_prefix = "",
    other_hints_prefix = "",
    },
    },

    -- all the opts to send to nvim-lspconfig
    -- these override the defaults set by rust-tools.nvim
    -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
    server = {}, -- rust-analyer options
    }
    require('rust-tools').setup(opts)
    require('nvim-autopairs').setup({
    enable_check_bracket_line = false
    })
    EOF

    nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
    nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
    nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
    nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
    nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
    nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
    nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
    nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
    nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
    nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
    autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics()

    " Goto previous/next diagnostic warning/error
    nnoremap <silent> g[ <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
    nnoremap <silent> g] <cmd>lua vim.lsp.diagnostic.goto_next()<CR>
    " Completion
    lua <<EOF
    require'compe'.setup {
    enabled = true;
    autocomplete = true;
    debug = false;
    min_length = 1;
    preselect = 'enable';
    throttle_time = 80;
    source_timeout = 200;
    incomplete_delay = 400;
    max_abbr_width = 100;
    max_kind_width = 100;
    max_menu_width = 100;

    source = {
    path = true;
    buffer = true;
    calc = true;
    vsnip = true;
    nvim_lsp = true;
    nvim_lua = true;
    spell = true;
    tags = true;
    snippets_nvim = true;
    };

    }
    EOF

    " Use <Tab> and <S-Tab> to navigate through popup menu
    inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
    inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
    inoremap <silent><expr> <C-Space> compe#complete()
    inoremap <silent><expr> <CR> compe#confirm('<CR>')
    inoremap <silent><expr> <C-e> compe#close('<C-e>')
    " Enable type inlay hints
    autocmd CursorMoved,InsertLeave,BufEnter,BufWinEnter,TabEnter,BufWritePost *
    \ lua require'lsp_extensions'.inlay_hints{ prefix = '', highlight = "Comment", enabled = {"TypeHint", "ChainingHint", "ParameterHint"} }



    """"telescope
    "" Find files using Telescope command-line sugar.
    nnoremap <leader>ff <cmd>Telescope find_files<cr>
    nnoremap <leader>fg <cmd>Telescope live_grep<cr>
    nnoremap <leader>fb <cmd>Telescope buffers<cr>
    nnoremap <leader>fh <cmd>Telescope help_tags<cr>
    nnoremap <leader>fl <cmd>Telescope git_files<cr>

    """"""nvim tree""""""
    "nnoremap <leader>tt :NvimTreeToggle<CR>
    "nnoremap <leader>tr :NvimTreeRefresh<CR>
    "nnoremap <leader>tn :NvimTreeFindFile<CR>
    "" NvimTreeOpen and NvimTreeClose are also available if you need them

    ""Emmet
    "let g:user_emmet_settings = {
    "\ 'javascript' : {
    "\ 'extends' : 'jsx',
    "\ },
    "\}
    "let g:user_emmet_install_global = 1
    "autocmd FileType html,css,javascript.jsx EmmetInstall


    "let g:user_emmet_leader_key='<TAB>'

    vmap <leader>cc <plug>NERDCommenterToggle
    nmap <leader>cc <plug>NERDCommenterToggle