Open wangw469 opened 9 months ago
" view set wildmenu syntax on
if has("gui_vimr") || has("gui_running") " Here goes some VimR specific settings like set guifont=courier\ new:h20 color delek set background=light else set guifont=courier\ new:h20 color default set background=dark endif
set complete-=i
" file format " " tabstop: Width of tab character " softtabstop: Fine tunes the amount of white space to be added " shiftwidth Determines the amount of whitespace to add in normal mode " expandtab: When this option is enabled, vi will use spaces instead of tabs set tabstop =4 set softtabstop =4 set shiftwidth =4 set expandtab
set autoindent set nonumber filetype plugin indent on " set colorcolumn=80 " set textwidth=80 " set formatoptions+=m
" Note, perl automatically sets foldmethod in the syntax file "autocmd Syntax c,cpp,vim,xml,html,xhtml,lua setlocal foldmethod=syntax "autocmd Syntax c,cpp,vim,xml,html,xhtml,perl,lua normal zR
" set laststatus=2 " if has("statusline") " set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P " endif
" search & file navagation shortcuts set hlsearch set incsearch
nnoremap
" toolkit
" nmap cp :let @* = expand("%:p")
function! g:ChmodOnWrite() if v:cmdbang silent !chmod u+w % endif endfunction
autocmd! bufwritepost vimrc source %
" auto save for every second " set autosave=1
" if has("multi_byte") " if &termencoding == "" " let &termencoding = &encoding " endif " set encoding=utf-8 " setglobal fileencoding=utf-8 " "setglobal bomb " set fileencodings=ucs-bom,utf-8,latin1 " endif
" find files and populate the quickfix list
" fun! FindFiles(filename)
" let error_file = tempname()
" silent exe '!find . -name "'.a:filename.'" | xargs file | sed "s/:/:1:/" > '.error_file
" set errorformat=%f:%l:%m
" exe "cfile ". error_file
" copen
" call delete(error_file)
" endfun
" command! -nargs=1 FindFile call FindFiles(
execute pathogen#infect()
" ------------------------------------
" plugins
" ------------------------------------
" .vimrc
let g:auto_save = 1 " enable AutoSave on Vim startup
" ctrlp
" cd ~/.vim/bundle && \
" git clone https://github.com/kien/ctrlp.vim.git
" let g:ctrlp_map = '
" cd ~/.vim/bundle " git clone https://github.com/Lokaltog/vim-easymotion let g:EasyMotion_do_mapping = 0 " Disable default mappings
" Bi-directional find motion
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" s{char}{label}
nmap s s{char}{char}{label}
" Need one more keystroke, but on average, it may be more comfortable.
nmap s
" Turn on case sensitive feature let g:EasyMotion_smartcase = 1
" JK motions: Line motions
map
local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim" vim.cmd.source(vimrc)
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath)
require("lazy").setup( ({ {'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' }}, 'mfussenegger/nvim-jdtls', 'williamboman/mason.nvim', "williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig", 'nvim-treesitter/nvim-treesitter', }) )
require("mason").setup() require("mason-lspconfig").setup()
require'lspconfig'.pyright.setup{} require'lspconfig'.tsserver.setup{}
vim.keymap.set('n', '', require'telescope.builtin'.live_grep)
-- Global mappings. -- Seee', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', 'q', vim.diagnostic.setloclist)
:help vim.diagnostic.*
for documentation on any of the below functions vim.keymap.set('n', '-- Use LspAttach autocommand to only map the following keys -- after the language server attaches to the current buffer vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('UserLspConfig', {}), callback = function(ev) -- Enable completion triggered by
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
end, })