view .vimrc @ 21:20ce06ac3a68 default tip

updated coc settings
author Luka Sitas <lsitas@avatarasoftware.com>
date Wed, 04 Mar 2026 13:41:22 -0500
parents 7cc13548becc
children
line wrap: on
line source

" Leader Mappings
map <Space> <leader>
map <Leader>w :update<CR>
map <Leader>q :qall<CR>
set mouse=a
inoremap <C-a> <C-x><C-i>

colorscheme desert

" Support for tags closing and classes
source $HOME/.vim/plugins/core/core.vim
source $HOME/.vim/plugins/vim-ai.vim
source $HOME/.vim/plugins/taghelp.vim
source $HOME/.vim/plugins/dbtables/dbtables.vim
source $HOME/.vim/plugins/hghelp/hghelp.vim
source $HOME/.vim/plugins/globalsearch.vim
source $HOME/.vim/plugins/voicenote/voicenote.vim


let g:db_user = ""      " Replace with your default database username
let g:db_password = ""  " Replace with your default database password
let g:db_name = ""      " Replace with your default database name
let g:db_host = ""      " Replace with your default database name

function! GeneratePhpCtags()
 let command = 'ctags -R --fields=+aimS --php-kinds=cdfint --languages=php --extras=+q --tag-relative=yes --exclude=".git" --exclude=".hg" --exclude="node_modules" --exclude="composer.phar" --totals=yes'
 let output = system(command)
endfunction

syntax on
syntax enable
" File types
autocmd Filetype scss if getfsize(@%) > 300 | setlocal syntax=OFF | endif
highlight Comment cterm=italic gui=italic
autocmd FileType *.blade.php setlocal commentstring=#\ %s
autocmd BufNewFile,BufRead *.php set iskeyword+=$

set path+=**
set nowrap                            " Dont wrap
set backspace=indent,eol,start        " http://vi.stackexchange.com/a/2163
set laststatus=2                      " Show status line on startup
set splitright                        " Open new splits to the right
set splitbelow                        " Open new splits to the bottom
set lazyredraw                        " Reduce the redraw frequency
set ttyfast                           " Send more characters in fast terminals
set nobackup nowritebackup noswapfile " Turn off backup files
set noerrorbells novisualbell         " Turn off visual and audible bells
set shiftwidth=4 tabstop=4
set history=500
set hlsearch                          " Highlight search results
set ignorecase smartcase              " Search queries intelligently set case
set incsearch                         " Show search results as you type
set timeoutlen=1000 ttimeoutlen=0     " Remove timeout when hitting escape
set showcmd                           " Show size of visual selection
set smartindent		   	      " Automatic formating/indenting

" Persistent undo
set undodir=~/.vim/undo/
set undofile
set undolevels=1000
set undoreload=10000

" Tags
set tags=./tags,tags;$HOME


"-------------------------------------------------------------------------------
" Interface
"-------------------------------------------------------------------------------

set number            " Enable line numbers
set relativenumber    " Enable relative line numbers
set scrolloff=5       " Leave 5 lines of buffer when scrolling
set sidescrolloff=10  " Leave 10 characters of horizontal buffer when scrolling


nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>



"-------------------------------------------------------------------------------
" Plugins
"-------------------------------------------------------------------------------
" Ensure that plug-vim is set up
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin()
" Environment Plugins
"
" NERDTree
source $HOME/.vim/plugins/nerdtree.vim

" Coding and language specifics
"
" LSP - ale
" source $HOME/.vim/plugins/ale.vim

" Blade
Plug 'jwalton512/vim-blade', { 'for': 'php' }
" Use release branch (recommended)
source $HOME/.vim/plugins/coc.vim
Plug 'phpactor/phpactor', {'for': 'php', 'tag': '*', 'do': 'composer install --no-dev -o'}" Plug 'preservim/tagbar' 

" AI-ify
Plug 'madox2/vim-ai'

call plug#end()

" CTRLP
source $HOME/.vim/plugins/ctrlp.vim

" Netwr
set nocp
filetype plugin on          " plugins are enabled


" Use project based .vimrc's
set exrc


" Get some better php support for ale see https://github.com/dense-analysis/ale/blob/master/supported-tools.md



" Log current working directory with timestamp to a cache file
function! LogCwdToCache()
  " Path to your cache file (change if you want)
  let l:cachefile = expand('~/.vim_cwd_cache')

  " Get timestamp and current working directory
  let l:timestamp = strftime('%Y-%m-%d %H:%M:%S')
  let l:cwd       = getcwd()

  " Append line: "YYYY-MM-DD HH:MM:SS /path/to/dir"
  call writefile([l:timestamp . ' ' . l:cwd], l:cachefile, 'a')
endfunction

" Example mappings/commands to trigger it:
" Call manually:
command! LogCwd call LogCwdToCache()

" Or log automatically on VimEnter:
autocmd VimEnter * call LogCwdToCache()