Skip to content

Commit

Permalink
more changes to keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslav11 committed May 25, 2023
1 parent 57feff2 commit 20f58af
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
11 changes: 11 additions & 0 deletions a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import torch

transformer = torch.nn.Transformer()

transformer

def func():
print(torch.__version__)

def new_func():
print(torch.__version__)
3 changes: 2 additions & 1 deletion coc-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"diagnostic.enableHighlightLineNumber": true,
"signature.enable": true,
"clangd.fallbackFlags": [ "-std=c++17" ],
"python.pythonPath": "~/.config/nvim/coc-pyright-run-py"
"python.pythonPath": "~/.config/nvim/coc-pyright-run-py",
"diagnostic.checkCurrentLine": true
}
23 changes: 21 additions & 2 deletions init.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set termguicolors
let g:python_host_prog="/opt/homebrew/bin/python"

call plug#begin()
Plug 'nvim-lualine/lualine.nvim'
Expand Down Expand Up @@ -163,8 +164,7 @@ let g:formatters_c = ['custom_astyle']
let g:formatdef_custom_black = '"black -l 79 --preview"'
let g:formatters_py = ['custom_black']

nmap <Tab> :Autoformat<CR>:call coc#refresh()<CR>
nmap <F5> :CocDiagnostics<CR>
nmap <Tab> :Autoformat<CR>
" It's annoying otherwise
source ~/.config/nvim/cyrilic.vim
Expand Down Expand Up @@ -198,6 +198,25 @@ endfunction

inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
" Default coc.nvim code inspection settings
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> K :call ShowDocumentation()<CR>
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction

" Disable Copilot for large files
autocmd BufReadPre *
\ let f=getfsize(expand("<afile>"))
Expand Down
8 changes: 6 additions & 2 deletions lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ require("telescope").setup({
file_sorter = require("telescope.sorters").get_fzy_sorter,
prompt_prefix = " >",
color_devicons = true,

file_previewer = require("telescope.previewers").vim_buffer_cat.new,
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,

layout_strategy = "horizontal",
layout_config = {
horizontal = {
Expand All @@ -37,6 +35,12 @@ require("telescope").setup({
preview_height = 0.5,
},
},
mappings = {
i = {
["<C-j>"] = require("telescope.actions").move_selection_next,
["<C-k>"] = require("telescope.actions").move_selection_previous,
},
},
},
})

Expand Down
2 changes: 1 addition & 1 deletion ycm_extra_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def FlagsFromInclude(root):
try:
include_path = FindNearest(root, 'include')
flags = BASE_FLAGS
for dirroot, dirnames, filenames in os.walk(include_path):
for dirroot, dirnames, _ in os.walk(include_path):
for dir_path in dirnames:
real_path = os.path.join(dirroot, dir_path)
flags = flags + ["-I" + real_path]
Expand Down

0 comments on commit 20f58af

Please sign in to comment.