DEV Community

Cover image for Best Coding Setup on Your Phone
Rajnish Anand
Rajnish Anand

Posted on

Best Coding Setup on Your Phone

I tried lots of coding editors and this is the πŸ‘Œbest Coding Setup i came up with.

features:

  • Its faster (unlike most code editors which starts lagging when file size gets bigger).
  • Its efficient.
  • It has Auto Suggestions
  • Support almost all languages including Nodejs, python, Go, lua, Kotlin ...
  • Basically a fully functioning VSCode
  • You can customise each feature according to you.

For showcase here:
Glitchi a fully functioning discord bot featuring dev-tools and Utilities. completely made using Termux.


What are we Using ?

We are using Termux as our command line and NeoVim a terminal based text editor making it faster than any other code Editor.

We'll start with Termux :

  • Installation
  • Installing essential packages
  • Making You Terminal look like 10x
  • Links to learn and Explore about Termux

NeoVim :

  • About NeoVim
  • basic Commands and Links to learn it from
  • Upgrading NeoVim (nvim) with cool😎 plugins
  • Links to learn and Explore about nvim

screenshot

[1] 🐧Termux :

Those who don't know what's Termux.

Termux is a free and open source terminal emulator for Android which allows for running a Linux environment on an Android device.πŸ€–

For more search on google.🀭

🌟Some basic commands :

  • ls- list files in current directory (folder)
  • ls -al - list all files with all details
  • pwd - print current path
  • cd - change directory
  • apt - for installing packages
  • pkg - this command also installs packages but meanwhile it also updates package-repo lists (don't use this command outside termux)

[1.1] Installing Termux :

Download and Install termux latest version (currently: 0.118.0) from F-droid link below.
Termux F-droid link

(if you have installed from playstore uninstall it).
From Termux Devlopers:
Playstore termux depreciation


[1.2] Installing essential packages :

Install essential packages like nodejs,git,python,... using pkg command

we're about to use NeoVim so we'll also install neovim

pkg install git nodejs python neovim
Enter fullscreen mode Exit fullscreen mode

[1.3] Making your Terminal look like 10x

screenshot

[1.3.1] Install zsh (Z Shell)

A shell similar to bash but more Customisable.

install by running :

apt install zsh
Enter fullscreen mode Exit fullscreen mode

[1.3.2] Install ohmyzsh

OhMyZsh is a framework for managing your zsh configuration.

Install it by pasting : (πŸ‘‡script by ohmyzsh devs) [TRUSTED]

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

it will prompt:
Do you want to change default shell to zsh?
press y

[1.3.3] Installing powerlevel10k (p10k)

powerlevel10k is one of the best theme for zsh.

run the following to save this theme in zsh theme folder :
(πŸ‘‡script by powerlevel10k devlopers) [TRUSTED]

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Enter fullscreen mode Exit fullscreen mode

you won't notice any changes βœ…

[1.3.4] setting p10k as your zsh Theme

run: πŸ‘‰nvim ~/.zshrcπŸ‘ˆ to open zsh configuration file in neovim

basic help to use nvim :

  • i : "enter edit/insert mode"
  • <esc> : "back to normal mode"
  • :wq : "save and exit"
  • :q : "exit"
  • :!q : "force exit"

edit ~/.zshrc and add ZSH_THEME="powerlevel10k/powerlevel10k" just like this :
.zshrc

now close/end your termux session using exit command or ctrl+d
Open your termux again and answer all the questions correctly/desired/recommend.✍️

don't worry if you choose wrong option or you ever want to configure your p10k theme.You can run p10k configure anytime.✨🎊πŸ₯³πŸŽ‰

if you don't like this Theme you there are many built-in themes lists here : ohmyzsh Themes

[1.3.5] Some Zsh plugins

Basically go and search on Google and install it.
screenshot
Screenshot of Plugins I'm using right now.

btw if you find any cool plugins you should definitely share it with meπŸ€—. just name it in the comments.


[1.4] Links to learn and Explore about Termux

[1.4.1] learn to use bash

Bash in 100 seconds: https://youtu.be/I4EWvMFj37g
Beginner's Guide: https://youtu.be/oxuRxtrO2Ag
πŸ˜… Yes you can google it and learn from anywhere possible.

[1.4.2] Customizing your Termux

Termux wiki: https://wiki.termux.com
This termux wiki isn't so big you should probably read it and its worth reading.

Termux Discord Server: https://discord.gg/HXpF69X
You can always ask for help here if you can't find on google.


[2] NeoVim

[2.1] About NeoVim

Neovim is a community driven open source project and a forked version of the Vim text editor built to make Vim easier to maintain for its core developers.πŸ€–

Basically NeoVim is Vim Patched by NeoVim Community Devlopers
Although almost all commands are same as Vim so while googling you should use vim instead of NeoVim to get more search results.

Those who don't know what's Vim better watch this video right now : VIM in 100 second

Now you should ask why NeoVim not Vim ?
well its not much of a difference you can use VIM instead but NeoVim has better GUI. so I'm going with NeoVim.


[2.2] Basics nvim commands

Don't worry πŸ˜… bore you with bunch of commands. just some basics its same as we discussed earlier.

basic help to use nvim :

  • i : "enter edit/insert mode"
  • <esc> : "back to normal mode"
  • :wq : "save and exit"
  • :q : "exit"
  • :!q : "force exit"

just these and ☺️ this crash course: VIM Crash course
by one of my favourite Youtuber: Ben Awad


[2.3] Upgrading NeoVim (nvim) with cool😎 plugins

we'll add some cool Neovim plugins to upgrade its UI and basically we'll make it look like VSCode.

We'll use one of the most popular vim plugin Manager: vim-plug

[2.3.1] Installing vim-plug

run the following : (πŸ‘‡ script by vim-plug devs) [TRUSTED]

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
Enter fullscreen mode Exit fullscreen mode

For more about vim-plug visit its git-repo : vim-plug

[2.3.2] How to add Plugins

you have to create ~/.config/nvim/init.vim run :

mkdir ~/.config/
mkdir ~/.config/nvim
touch ~/.config/nvim/init.vim
Enter fullscreen mode Exit fullscreen mode

Now you can add Plugins simply by adding plugin git-repo link/name in between call plug#begin() and call plug#end() like this :
init.vim

[2.3.3] Installing CoC

To make nvim smart as VSCode
GIF

Plug this πŸ‘‡ in your ~/.config/nvim/init.vim using nvim : nvim ~/.config/nvim/init.vim

" Use release branch (recommend)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Enter fullscreen mode Exit fullscreen mode

save and quit and open nvim again : nvim
run in nvim: :PlugInstall
and run: :CocInstall coc-json coc-tsserver

you might need to install some CoC-plugins/packages based on language you are coding. You can Google it🀘.

[2.3.4] More configurations

Here you have two choices you can either copy my vim.init file and your nvim will be like mine or You can follow ben Awad and customise accordingly.

Using My nvim configurations : My init.vim
you can copy paste or run this and everything will be installed:

cd ~/.config/nvim
curl -o init.vim https://gist.githubusercontent.com/RajnishAnand/30b26d1772c0a22a32475d2bba8613bf/raw/e2b1664485f3f731b176d8c6e155b1035f1bba4d/init.vim 
cd -
nvim +PlugInstall

Enter fullscreen mode Exit fullscreen mode

Now you can ctrl+t to toggle :
NERDTree
vs-code like file viewer side by side

press ? to toggle NERDTree Help:
NERDTree HELP

you should definitely check each plugins to check its features.


[2.4] Links to learn and Explore about nvim

Learn vim while Playing (PC users only):
https://vim-adventures.com/
Neovim Official Docs:
https://neovim.io/doc/user/

And like always how stupid it might look you can google it. πŸ˜…


πŸŽ‰πŸŽ‰πŸ₯³πŸŽŠ THE END 🎊πŸ₯³πŸŽ‰πŸŽ‰


Discussion (1)

Collapse
arnavkr profile image
Arnav Kumar

One of the best articles on getting hands on to the coding just in your phone.
The themes and intellisense just feels like good pc code editors like vs code.