Skip to content

Instantly share code, notes, and snippets.

@andybp85
Last active January 10, 2025 09:39
Show Gist options
  • Select an option

  • Save andybp85/e5075c69d45c6d8d012ea89199935ea6 to your computer and use it in GitHub Desktop.

Select an option

Save andybp85/e5075c69d45c6d8d012ea89199935ea6 to your computer and use it in GitHub Desktop.
vim config 2024. needs vim-plug
syntax on
set nocompatible
set encoding=utf-8
set ffs=unix,dos,mac
set number
set relativenumber
set ruler
set tabstop=4
set shiftwidth=4
set expandtab
set cursorline
hi CursorLine term=bold cterm=bold guibg=Grey40
set lazyredraw
set backspace=indent,eol,start
set copyindent
set shiftround
set showmatch
set smartcase
set hlsearch
set incsearch
set modelines=1
set showcmd
set ttimeout
set timeoutlen=1000 ttimeoutlen=0
set mouse=a
set colorcolumn=120
set wildmode=longest,list,full
set wildmenu
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
set conceallevel=1
let mapleader=" "
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Wq wq
cnoreabbrev WQ wq
nmap <leader>w :w!<cr>
nmap <leader>q :q<cr>
nmap <leader>wa :wa<cr>
nmap <leader>wq :wq<cr>
nmap <leader>qa :qa<cr>
nmap <leader>wqa :wqa<cr>
call plug#begin()
Plug 'tpope/vim-sensible'
Plug 'phanviet/vim-monokai-pro'
Plug 'kien/rainbow_parentheses.vim'
Plug 'bling/vim-airline'
Plug 'elzr/vim-json'
Plug 'Valloric/YouCompleteMe'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'dense-analysis/ale'
Plug 'leafgarland/typescript-vim' " TypeScript syntax highlighting
Plug 'peitalin/vim-jsx-typescript' " TSX syntax highlighting
Plug 'Quramy/tsuquyomi' " TypeScript IDE features
call plug#end()
set termguicolors
colorscheme monokai_pro
let g:pymode_python = 'python3'
nmap <leader>t :Files<cr>
" ALE configuration for TypeScript
let b:ale_fixers = {
\ 'python': ['autoimport', 'autopep8'],
\ 'typescript': ['prettier', 'eslint'],
\ 'typescriptreact': ['prettier', 'eslint'],
\}
let g:ale_linters = {
\ 'typescript': ['eslint', 'tsserver'],
\ 'typescriptreact': ['eslint', 'tsserver'],
\}
" let g:ale_fix_on_save = 1
"
"" Keybindings for TypeScript
nmap <leader>gd :ALEGoToDefinition<cr> " Go to definition
nmap <leader>gr :ALEFindReferences<cr> " Find references
nmap <leader>gi :ALEImport<cr> " Import missing imports
" Enable mouse support and map Cmd+Click (or Ctrl+Click) to go to definition
if has("mac")
nmap <D-LeftMouse> <LeftMouse>:ALEGoToDefinition<cr>
else
nmap <C-LeftMouse> <LeftMouse>:ALEGoToDefinition<cr>
endif
set secure
@andybp85
Copy link
Author

andybp85 commented Jan 17, 2023

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \\
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

@andybp85
Copy link
Author

andybp85 commented Aug 15, 2024

vim compile:

> export PYTHON_CONFIGURE_OPTS="--enable-framework"
> arch --arm64 pyenv install  3.12.3
> pyenv global 3.12.3
> python -m venv penv
> source penv/bin/activate
> ./configure --with-features=huge --enable-multibyte --enable-gtk3-check --with-python3-command=python --enable-python3interp=yes
> sudo make install

vim plug:

> vim
:PlugInstall

YouCompleteMe (use penv created above)

> brew install cmake go
> cd .vim/plugged/YouCompleteMe/
> python install.py --all

@andybp85
Copy link
Author

added typescript support using DeepSeek - let's see if this works...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment