Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Plug 'https://github.com/neovim/nvim-lspconfig'
Plug 'https://github.com/tpope/vim-fugitive.git'
Plug 'https://github.com/tommcdo/vim-fugitive-blame-ext.git'
Plug 'https://github.com/sodapopcan/vim-twiggy.git'
Plug 'lewis6991/gitsigns.nvim'
Plug 'https://github.com/lewis6991/gitsigns.nvim'
Plug 'https://github.com/rhysd/git-messenger.vim.git'
Plug 'https://github.com/ruanyl/vim-gh-line'
Plug 'sindrets/diffview.nvim'
Expand All @@ -45,8 +45,7 @@ Plug 'https://github.com/kyazdani42/nvim-tree.lua'

" Language
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'sheerun/vim-polyglot'
Plug 'tami5/lspsaga.nvim', { 'branch': 'nvim51'}
Plug 'tami5/lspsaga.nvim'
Plug 'editorconfig/editorconfig-vim'
Plug 'https://github.com/mattn/emmet-vim.git'
Plug 'https://github.com/alfredodeza/pytest.vim.git'
Expand All @@ -55,6 +54,8 @@ Plug 'mfussenegger/nvim-dap-python'
Plug 'Pocco81/DAPInstall.nvim'
Plug 'rcarriga/nvim-dap-ui'
Plug 'mhartington/formatter.nvim'
Plug 'https://github.com/Hoffs/omnisharp-extended-lsp.nvim.git'
Plug 'https://github.com/dart-lang/dart-vim-plugin.git'

" Auto complete
Plug 'https://github.com/onsails/lspkind-nvim.git'
Expand Down Expand Up @@ -84,9 +85,22 @@ Plug 'MattesGroeger/vim-bookmarks'
Plug 'https://github.com/tom-anders/telescope-vim-bookmarks.nvim.git'
Plug 'https://github.com/AckslD/nvim-neoclip.lua.git'
Plug 'sudormrfbin/cheatsheet.nvim'
Plug 'https://github.com/pseewald/vim-anyfold.git'
" If you have nodejs and yarn
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && npm install' }
Plug 'https://github.com/dhruvasagar/vim-table-mode'
Plug 'jremmen/vim-ripgrep'
Plug 'akinsho/flutter-tools.nvim'
Plug 'kkoomen/vim-doge', { 'do': { -> doge#install() } }

" Plug 'https://github.com/arcticicestudio/nord-vim.git'
Plug 'https://github.com/jcypret/nord-vim-midnight.git'

Plug 'kamykn/spelunker.vim'
Plug 'kamykn/popup-menu.nvim'

" Copilot
Plug 'https://github.com/github/copilot.vim.git'

" Initialize plugin system
call plug#end()
Expand All @@ -101,7 +115,8 @@ call plug#end()
:set more

" Performance boosters
:set nocursorline
:set cursorline cul
:set cursorcolumn cuc
:set lazyredraw
:set re=1
:set noshowcmd
Expand Down Expand Up @@ -154,7 +169,7 @@ let $NVIM_TUI_ENABLE_TRUE_COLOR=1

:set termguicolors
:set background=dark
:colorscheme hybrid_material
:colorscheme hybrid_reverse

" REMAPS
" Leader
Expand Down
179 changes: 146 additions & 33 deletions after/plugin/editor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']

augroup Format
autocmd!
autocmd BufWritePost *.js,*.jsx,*.ts,*.py FormatWrite
autocmd BufWritePost *.js,*.jsx,*.tsx,*.ts,*.py,*.json,*.dart,*.html FormatWrite
augroup END

lua << EOF
Expand All @@ -24,11 +24,62 @@ local node_formatters = {
end,
}

local json_formatter = {
function()
return {
exe = "prettier",
args = {"--stdin-filepath", vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)), "--double-quote"},
stdin = true
}
end
}

local dart_formatter = {
function()
return {
exe = "~/projects/taxfyle-mobile/flutter/bin/dart",

@radyz radyz Jun 22, 2022

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in a standard path: /opt/flutter/bin/dart, /usr/local/share/flutter/bin/dart or when installed with brew then it becomes /opt/homebrew/bin/dart

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using defaults: cee865d

@Xepe Xepe Jun 22, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, just did it in that way to use the flutter version that I built using the flutter repository

args = {"format"},
stdin = true
}
end
}

local htmldjango_formatter = {
function()
return {
exe = "djlint",
args = {"--reformat", "--preserve-blank-lines", "-"},
stdin = true
}
end
}

require "formatter".setup {
filetype = {
typescript = node_formatters,
javascript = node_formatters,
javascriptreact = node_formatters,
typescriptreact = node_formatters,
dart = dart_formatter,
lua = {
-- Pick from defaults:
require('formatter.filetypes.lua').stylua,

-- ,or define your own:
function()
return {
exe = "stylua",
args = {
"--search-parent-directories",
"--stdin-filepath",
util.escape_path(util.get_current_buffer_file_path()),
"--",
"-",
},
stdin = true,
}
end
},
python = {
function()
return {
Expand All @@ -37,11 +88,28 @@ require "formatter".setup {
stdin = true,
}
end
}
},
json = json_formatter,
htmldjango = htmldjango_formatter,
}
}
EOF

"=============================================================================
" LSP-CONFIG
"=============================================================================

nnoremap gi <cmd>lua vim.lsp.buf.implementation()<cr>

" Disable text object diagnostic to avoid overbloating UI
lua << EOF
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false
}
)
EOF

"=============================================================================
" TREESITTER
"=============================================================================
Expand All @@ -51,9 +119,8 @@ set foldexpr=nvim_treesitter#foldexpr()
set foldminlines=50
set foldnestmax=2

lua <<EOF
lua << EOF
local parser_configs = require("nvim-treesitter.parsers").get_parser_configs()

parser_configs.http = {
install_info = {
url = "https://github.com/NTBBloodbath/tree-sitter-http",
Expand All @@ -62,30 +129,18 @@ parser_configs.http = {
},
}

require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained",
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = false,
},
ignore_install = { "phpdoc" },
ensure_installed = "all",
}
EOF



"=============================================================================
" LSP-CONFIG
"=============================================================================

" Disable text object diagnostic to avoid overbloating UI
lua << EOF
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false
}
)
EOF

"=============================================================================
" LSP-SAGA
"=============================================================================
Expand All @@ -103,6 +158,9 @@ nnoremap <silent><C-f> <cmd>lua require('lspsaga.action').smart_scroll_with_saga
nnoremap <silent><C-b> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>
nnoremap <silent><leader>cd :Lspsaga show_line_diagnostics<CR>

nnoremap <silent>gdj :Lspsaga diagnostic_jump_next<CR>
nnoremap <silent>gdk :Lspsaga diagnostic_jump_prev<CR>

lua << EOF
require("lspsaga").init_lsp_saga {
error_sign = '',
Expand Down Expand Up @@ -154,16 +212,16 @@ EOF
" LSP-CMP
"=============================================================================
lua <<EOF
require("cmp_tabnine.config"):setup {
max_lines = 1000,
max_num_results = 20,
sort = true,
}
-- require("cmp_tabnine.config"):setup {
-- max_lines = 1000,
-- max_num_results = 20,
-- sort = true,
-- }

local source_mapping = {
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
cmp_tabnine = "[TN]",
-- cmp_tabnine = "[TN]",
path = "[Path]",
ultisnips = "[Snippets]"
}
Expand Down Expand Up @@ -195,20 +253,75 @@ cmp.setup {
{ name = 'path' },
{ name = 'calc' },
{ name = 'ultisnips' },
{ name = 'cmp_tabnine' },
-- { name = 'cmp_tabnine' },
{ name = 'treesitter' },
}
}

require('lspconfig').tsserver.setup {
capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()),
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
}

require('lspconfig').pyright.setup {
capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()),
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
}

require('lspconfig').omnisharp.setup {
cmd = { '/usr/local/share/omnisharp/run', "--languageserver", "--hostPID", tostring(vim.fn.getpid())},
-- require('lspconfig').omnisharp.setup {
-- cmd = { '/usr/local/share/omnisharp/run', "--languageserver", "--hostPID", tostring(vim.fn.getpid())},
-- }
EOF

"=============================================================================
" FLUTTER-TOOLS
"=============================================================================
"
lua <<EOF
require("flutter-tools").setup {} -- use defaults
EOF

"=============================================================================
" DOGE
"=============================================================================
"
let g:doge_doc_standard_typescript='tsdoc'

"=============================================================================
" ANYFOLD
"=============================================================================
"
set foldlevel=99

"=============================================================================
" OMNISHARP LSP
"=============================================================================
"

lua <<EOF
-- vim.lsp.set_log_level("debug")

local pid = vim.fn.getpid()
-- We need to export he variable DOTNET_ROOT=/usr/local/share/dotnet
local omnisharp_bin = "/Users/jose.blanco/.local/omnisharp/OmniSharp"
-- local util = require('lspconfig').util

local config = {
-- capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()),
-- on_attach = function(_, bufnr)
-- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- end,
-- handlers = {
-- ["textDocument/definition"] = require('omnisharp_extended').handler,
-- },
cmd = { omnisharp_bin, '--languageserver' , '--hostPID', tostring(pid) },
-- rest of your settings
-- root_dir = function(file, _)
-- if file:sub(-#".csx") == ".csx" then
-- return util.path.dirname(file)
-- end
-- return util.root_pattern("*.sln")(file) or util.root_pattern("*.csproj")(file)
-- end,
}

require('omnisharp_extended').telescope_lsp_definitions()
require'lspconfig'.omnisharp.setup(config)
EOF
Loading