05 October 2022

My vim plugin bible - How to Make Vim a Python IDE - Best IDE for Python.

https://dev.to/shahinsha/how-to-make-vim-a-python-ide-best-ide-for-python-23e1

 

I revised it a little bit as -


set nocompatible              " required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'

" All Plugins

Plugin 'mhartington/oceanic-next'
Plugin 'tmhedberg/SimpylFold'      "<space>
Plugin 'vim-scripts/indentpython.vim'
Plugin 'vim-syntastic/syntastic'
" Plugin 'nvie/vim-flake8' (pip3 install flake8) <F7>
Plugin 'scrooloose/nerdtree'       ":nerd
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'zxqfl/tabnine-vim'
Plugin 'frazrepo/vim-rainbow'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'davidhalter/jedi-vim'       "Auto complete. Ctrl+<space>
Plugin 'ycm-core/YouCompleteMe'     "Automatic, or Ctrl-n


call vundle#end()            " required
filetype plugin indent on    " required


" setting horizontal and vertical splits
set splitbelow
set splitright

"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Enable folding
set foldmethod=indent
set foldlevel=99

" Enable folding with the spacebar
" nnoremap <space> za


" Setting up indendation

au BufNewFile, BufRead *.py
    \ set tabstop=4 |
    \ set softtabstop=4 |
    \ set shiftwidth=4 |
    \ set textwidth=79 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix

au BufNewFile, BufRead *.js, *.html, *.css
    \ set tabstop=2 |
    \ set softtabstop=2 |
    \ set shiftwidth=2

highlight BadWhitespace ctermbg=red guibg=darkred
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/

let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration<CR>

" setting up pyflakes

let python_highlight_all=1
syntax on

" nerd tree settings
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
nnoremap <leader>nerd :NERDTreeToggle      "by Sherman Chen

" setting up line numbering
set nu

" not break a word when newline
:set linebreak

" Max. row length 78
:set textwidth=78

" Rainbow bracket settings
let g:rainbow_active = 1

Vim plugin manager - Vim Pathogen

 I'd highly recommend installing vim pathogen if you want to see the universe of vim plugins.  

It's a package manager of sorts. Once you install it, you can git clone packages to your ~/.vim/bundle directory and they're auto-installed. No more plugin installation, maintenance, or uninstall headaches! 

 You can run the following script from the GitHub page to install pathogen:  

mkdir -p ~/.vim/autoload ~/.vim/bundle; \ 
curl -so ~/.vim/autoload/pathogen.vim \     
    https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim

01 October 2022

speedtest error on ubuntu terminal

When I ran 

$ speedtest

I got 

Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: HTTP Error 403: Forbidden

Solution:


Hi, @fixit7 .

I've never ran speedtest-cli but, after a web search, I've found the following Reddit post (in the subreddit "r/Linux4noobs 10") that was posted 23 days ago:

In that Reddit post, the original poster ("u/CryPTuuNe 3") wrote the following:

"(...) I just setup Ubuntu on my new PC. For testing purposes I installed the speedtest-cli and with the command Speedtest everything worked fine. I don't know what I did then, but now I am getting an http error 403 forbidden. But when doing speedtest --secure everything works fine again. (...)"

According to the "speedtest-cli" manpage - Ubuntu Manpage: speedtest-cli - Command line interface for testing internet bandwidth using speedtest.net 81 - the "--secure" switch has the following meaning:

--secure
Use HTTPS instead of HTTP when communicating with speedtest.net 28 operated servers

I hope this helps.